Solved

php regular expressions

Posted on 2006-06-20
2
216 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 500 total points
Comment Utility
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
Comment Utility
thanks a million
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now