Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

php regular expressions

Posted on 2006-06-20
2
Medium Priority
?
235 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
2 Comments
 
LVL 7

Accepted Solution

by:
maUru earned 2000 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

885 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