[PHP] ereg_replace help

2004-03-18 Thread Richard Davey
Hi all, I'm sure this is blindingly simple, but could anyone tell me how to get an ereg_replace() to return a string where all characters OTHER than alpha-numerics have been stripped out? I can do the reverse with: $output = ereg_replace('[[:alnum:]]', '', $string); Which will happily remove

Re: [PHP] ereg_replace help

2004-03-18 Thread John W. Holmes
From: Richard Davey [EMAIL PROTECTED] I'm sure this is blindingly simple, but could anyone tell me how to get an ereg_replace() to return a string where all characters OTHER than alpha-numerics have been stripped out? $output = ereg_replace('[^a-zA-Z0-9]','',$string); The ^ is NOT (when the

Re: [PHP] ereg_replace help

2004-03-18 Thread Chris Hayes
At 16:21 18-3-04, you wrote: I can do the reverse with: $output = ereg_replace('[[:alnum:]]', '', $string); Which will happily remove all alpha-numeric characters from $string! But I want it to remove anything but.. suggestions please? did you try $output = ereg_replace('[^[:alnum:]]', '',

Re[2]: [PHP] ereg_replace help

2004-03-18 Thread Richard Davey
Hello Chris, Thursday, March 18, 2004, 3:28:01 PM, you wrote: CH did you try CH $output = ereg_replace('[^[:alnum:]]', '', $string); CH ? Nope, because in the only reference book I had to hand it said the ^ matched the start of a string so it didn't occur to me to try it. Thanks to John I now

Re: Re[2]: [PHP] ereg_replace help

2004-03-18 Thread trlists
On 18 Mar 2004 Richard Davey wrote: Nope, because in the only reference book I had to hand it said the ^ matched the start of a string so it didn't occur to me to try it. Thanks to John I now know when used in a block it's no longer limited to the start of the string. The code you posted

Re: [PHP] ereg_replace help

2003-11-18 Thread Eugene Lee
On Tue, Nov 18, 2003 at 04:37:52PM +1100, Martin Towell wrote: : : I have an array of strings in the following format: : abcd - rst : abcd - uvw : abcd - xyz : foobar - rst : blah - rst : googol - uvw : : What I want to do is strip everything from the - bit

Re: [PHP] ereg_replace help

2003-11-18 Thread Jason Wong
On Tuesday 18 November 2003 13:37, Martin Towell wrote: I have an array of strings in the following format: abcd - rst abcd - uvw abcd - xyz foobar - rst blah - rst googol - uvw What I want to do is strip everything from the - bit of the string to

Re: [PHP] ereg_replace help

2003-11-18 Thread Henrik Hudson
On Monday 17 November 2003 23:37, Martin Towell [EMAIL PROTECTED] sent a missive stating: Hi All, I have an array of strings in the following format: abcd - rst abcd - uvw abcd - xyz foobar - rst blah - rst googol - uvw What I want to do is strip

Re: [PHP] ereg_replace help

2003-11-18 Thread Robert Cummings
On Tue, 2003-11-18 at 02:30, Jason Wong wrote: On Tuesday 18 November 2003 13:37, Martin Towell wrote: I have an array of strings in the following format: abcd - rst abcd - uvw abcd - xyz foobar - rst blah - rst googol - uvw What I want to do is strip

Re: [PHP] ereg_replace help

2003-11-18 Thread Curt Zirzow
* Thus wrote Martin Towell ([EMAIL PROTECTED]): Hi All, I have an array of strings in the following format: abcd - rst abcd - uvw abcd - xyz foobar - rst blah - rst googol - uvw What I want to do is strip everything from the - bit of the string to

RE: [PHP] ereg_replace help

2003-11-18 Thread Martin Towell
* Thus wrote Martin Towell ([EMAIL PROTECTED]): Hi All, I have an array of strings in the following format: abcd - rst abcd - uvw abcd - xyz foobar - rst blah - rst googol - uvw What I want to do is strip everything from the - bit of the string

[PHP] ereg_replace help

2003-11-17 Thread Martin Towell
Hi All, I have an array of strings in the following format: abcd - rst abcd - uvw abcd - xyz foobar - rst blah - rst googol - uvw What I want to do is strip everything from the - bit of the string to the end, _but_ only for the strings that don't

[PHP] ereg_replace Help

2002-03-21 Thread lists
Hi all, I have a large file that I am trying to parse. I have a many lines that look like this \\text1 I need an expression that will change \\text1 to text1= so if I have something like this \\text1 asdfkjaslkfj asdlfkjasljkf asdlkfjasldfkj asldkfjalskfj \\text2 erweiurwoeir werqwer

RE: [PHP] ereg_replace help

2002-02-04 Thread Lars Torben Wilson
: Monday, February 04, 2002 4:32 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] ereg_replace help I'm not actually replacing \n with br, I just used that as an example. When I tried Martin's solution, I got a parse error on this line: $content = implode($lines, \n,); I checked

[PHP] ereg_replace help

2002-02-03 Thread John P. Donaldson
I have a file open and can successfully write to it, but I was to be able to search for a certain string of text and replace it with a string of text. I can't figure out how to construct a proper ereg_replace statement to search through this file and do the replacing. Examples I've seen are in

RE: [PHP] ereg_replace help

2002-02-03 Thread Martin Towell
, February 04, 2002 3:39 PM To: php Subject: [PHP] ereg_replace help I have a file open and can successfully write to it, but I was to be able to search for a certain string of text and replace it with a string of text. I can't figure out how to construct a proper ereg_replace statement to search

Re: [PHP] ereg_replace help

2002-02-03 Thread Mike Frazer
in file as an array $content = implode(br, $lines); // join it all back together fopen(...); fputs(..., $content); fclose(...); hope this helps -Original Message- From: John P. Donaldson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 3:39 PM To: php Subject: [PHP] ereg_repl

Re: [PHP] ereg_replace help

2002-02-03 Thread John P. Donaldson
Message- From: John P. Donaldson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 3:39 PM To: php Subject: [PHP] ereg_replace help I have a file open and can successfully write to it, but I was to be able to search for a certain string of text and replace it with

RE: [PHP] ereg_replace help

2002-02-03 Thread Martin Towell
-Original Message- From: John P. Donaldson [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 4:32 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] ereg_replace help I'm not actually replacing \n with br, I just used that as an example. When I tried Martin's solution, I got a parse error

Re: [PHP] ereg_replace help

2002-02-03 Thread Jason Wong
On Monday 04 February 2002 13:31, John P. Donaldson wrote: I'm not actually replacing \n with br, I just used that as an example. When I tried Martin's solution, I got a parse error on this line: $content = implode($lines, \n,); You've got a trailing comma. -- Jason Wong - Gremlins

[PHP] ereg_replace: Help!

2001-04-23 Thread Erica Douglass
I have one ereg_replace problem that I cannot seem to fix. I need to delete an IMG tag. The only thing I know about this tag is that it will contain SRC=images/headers in the string. Here is an example: IMG ALT=Tools BORDER=0 HEIGHT=55 SRC=images/headers/tools.gif WIDTH=455 I tried this,

Re: [PHP] ereg_replace: Help!

2001-04-23 Thread Plutarck
This works: $str = 'IMG ALT=Tools BORDER=0 HEIGHT=55 SRC=images/headers/tools.gif WIDTH=455'; echo eregi_replace(IMG.+SRC=\images/headers.*, Replaced, $str); -- Plutarck Should be working on something... ...but forgot what it was. Erica Douglass [EMAIL PROTECTED] wrote in message [EMAIL