Solved

php regular expressions

Posted on 2006-06-20
2
230 Views
Last Modified: 2010-07-27
Hi

I have a perl expression which reads

$l =~ s/^V\#REPLACEME^X^Y^W/$somevariable/

can you tell me if  in php

ereg_replace("(.*)^V\#REPLACEME^X^Y^W(.*)", $replacestring, $originaldata)

is the right way of writing the same regex?

thanks in advance

0
Comment
Question by:Vlearns
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
maUru earned 500 total points
ID: 16941206
echo preg_replace('/^V\#REPLACEME^X^Y^W/', $somevariable, $originaldata)

would probably be the right way, although for the life of me i cant understand what the point of ^V ^X^Y^Z is for.
0
 

Author Comment

by:Vlearns
ID: 16949008
thanks a million
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question