Re: [PHP] Reg Exp.

2004-08-18 Thread John Holmes
Jay wrote: Why can“t i get this code to work: $html = $_POST["htmlIn"]; $patterns[0] = "//"; $patterns[1] = "//"; $patterns[2] = "/align=\"left\"/"; $replacements[0] = ""; $replacements[1] = ""; $replacements[2] = " style=\"text-align:left;\""; $xhtml = preg_replace($patterns, $replacements, $html)

Re: [PHP] Reg Exp.

2004-08-18 Thread Jay
Wudi wrote: > On Wed, 18 Aug 2004 10:42:54 +0200 > Jay <[EMAIL PROTECTED]> wrote: > > >>Hi! >> >>Why can? i get this code to work: >>$html = $_POST["htmlIn"]; >> >>$patterns[0] = "//"; >>$patterns[1] = "//"; >>$patterns[2] = "/align=\"left\"/"; >> >>$replacements[0] = ""; >>$replacements[1] = ""

Re: [PHP] Reg Exp.

2004-08-18 Thread Jay
Ni Shurong wrote: >>Hi! >> >>Why can? i get this code to work: >>$html = $_POST["htmlIn"]; >> >>$patterns[0] = "//"; >>$patterns[1] = "//"; > > $patterns[1] = "/<\/strike>/"; > >>$patterns[2] = "/align=\"left\"/"; >> >>$replacements[0] = ""; >>$replacements[1] = ""; >>$replacements[2] = " style=

Re: [PHP] Reg Exp.

2004-08-18 Thread Jay
Ni Shurong wrote: >>Hi! >> >>Why can? i get this code to work: >>$html = $_POST["htmlIn"]; >> >>$patterns[0] = "//"; >>$patterns[1] = "//"; > > $patterns[1] = "/<\/strike>/"; > >>$patterns[2] = "/align=\"left\"/"; >> >>$replacements[0] = ""; >>$replacements[1] = ""; >>$replacements[2] = " style=\

Re: [PHP] Reg Exp.

2004-08-18 Thread Wudi
On Wed, 18 Aug 2004 10:42:54 +0200 Jay <[EMAIL PROTECTED]> wrote: > Hi! > > Why can? i get this code to work: > $html = $_POST["htmlIn"]; > > $patterns[0] = "//"; > $patterns[1] = "//"; > $patterns[2] = "/align=\"left\"/"; > > $replacements[0] = ""; > $replacements[1] = ""; > $replacements[2] =

Re: [PHP] Reg Exp.

2004-08-18 Thread Ni Shurong
> Hi! > > Why can? i get this code to work: > $html = $_POST["htmlIn"]; > > $patterns[0] = "//"; > $patterns[1] = "//"; $patterns[1] = "/<\/strike>/"; > $patterns[2] = "/align=\"left\"/"; > > $replacements[0] = ""; > $replacements[1] = ""; > $replacements[2] = " style=\"text-align:left;\""; > >

Re: [PHP] reg exp for smtp error codes

2004-04-23 Thread Curt Zirzow
* Thus wrote Robert Kornfeld ([EMAIL PROTECTED]): > hey professionals out there! > > does anybody have a script that parses the error-code from a returned > email-header (esmtp)? You dont need a regex, just a simple explode will work: list($code, $message) = explode(" ", $result_string, 2);

Re: [PHP] Reg Exp help needed

2003-06-24 Thread Don Read
On 24-Jun-2003 Sparky Kopetzky wrote: > I'm translating (hacking) code from Perl to PHP and have two reg exp > expressions I can't figure out what they do. > > 1st: $goodbadnum =~ tr/0-9//cd; I think this one removes any chars that > are not numbers. > Nope. That removes digits '0-9' $goodbadnu

Re: [PHP] reg exp matching/replacing

2002-10-03 Thread Jason D
Jen, Don't use eregi_replace when str_replace will do. $contents = str_replace($matches[0][$i], $blah, $contents); Also the dots should be escaped or gif and jpg without dots before them will be matched. preg_match_all('{\/*[A-z0-9_/-]+(\.gif|\.jpg)}', $contents, $matches);

RE: [PHP] Reg Exp issue

2002-09-20 Thread Thoenen, Peter Mr. EPS
Not that familiar with MySQL's flavor of RegEx (and the documentation seems to be extremely bad ... or at least I can't seem to find any with casually searching) but have you tried escaping the RegEx special characters? eg REGEXP ('ok\/2.0 \(hah 3\.0; BAM oh 5\.1; \.hi CLR 1\.0\.4725\)'); -Peter

Re: [PHP] Reg exp to remove line feeds before lines starting with white space

2002-07-25 Thread Analysis & Solutions
> On Thu, Jul 25, 2002 at 12:36:27PM +0200, Nicklas af Ekenstam wrote: > > > > In order to read the headers into an array of header key/value fields > > i would like a reg exp to remove all new lines/line feeds before a > > line starting with one or more white spaces or tabs. Pardon my prior pos

Re: [PHP] Reg exp to remove line feeds before lines starting withwhite space

2002-07-25 Thread Miguel Cruz
On Thu, 25 Jul 2002, Nicklas af Ekenstam wrote: > I'm trying to do some parsing of mail headers and since not all > headers follow the pattern: > > X-Header-A: A string > X-Header-B: Another string that is longer > X-Header-C: And this string is very very long compared > > But may very well look

Re: [PHP] Reg exp to remove line feeds before lines starting with white space

2002-07-25 Thread Analysis & Solutions
On Thu, Jul 25, 2002 at 12:36:27PM +0200, Nicklas af Ekenstam wrote: > > In order to read the headers into an array of header key/value fields > i would like a reg exp to remove all new lines/line feeds before a > line starting with one or more white spaces or tabs. In ereg_replace() you can use

Re: [PHP] reg exp problems

2002-06-01 Thread Michael Sims
On Sat, 1 Jun 2002 16:56:04 +0100, you wrote: >Hi, >I've never used a reg exp, but I was trying to do something simple, and I just can't >seem to do it :) > >I have a varible $fdata which contains the contents of a webpage, and I want to strip >out the tag. > >I try: >$fdata = preg_replace("",

Re: [PHP] reg exp problems

2002-06-01 Thread Andrew Brampton
ay, June 01, 2002 6:02 PM Subject: Re: [PHP] reg exp problems > On Saturday 01 June 2002 23:56, Andrew Brampton wrote: > > Hi, > > I've never used a reg exp, but I was trying to do something simple, and I > > just can't seem to do it :) > > > > I have a

Re: [PHP] reg exp problems

2002-06-01 Thread Jason Wong
On Saturday 01 June 2002 23:56, Andrew Brampton wrote: > Hi, > I've never used a reg exp, but I was trying to do something simple, and I > just can't seem to do it :) > > I have a varible $fdata which contains the contents of a webpage, and I > want to strip out the tag. > > I try: > $fdata = pre

RE: [PHP] Reg Exp Help

2002-01-25 Thread Zach Curtis
or less overhead than a single regular expression? Thank you. Zach -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 11:36 AM To: Zach Curtis Subject: Re: [PHP] Reg Exp Help You said: > The password and int_id begin

RE: [PHP] Reg Exp Help

2002-01-25 Thread Zach Curtis
day, January 25, 2002 10:29 AM To: Zach Curtis Subject: Re: [PHP] Reg Exp Help but if the positions as fixed, why don't you use the substr, and then trim th result? Edward - Original Message - From: "Zach Curtis" <[EMAIL PROTECTED]> To: "Edward van Bilderbeek

RE: [PHP] Reg Exp Help

2002-01-25 Thread Zach Curtis
nt: Friday, January 25, 2002 10:29 AM To: Zach Curtis Subject: Re: [PHP] Reg Exp Help but if the positions as fixed, why don't you use the substr, and then trim th result? Edward - Original Message - From: "Zach Curtis" <[EMAIL PROTECTED]> To: "Edward van Bild

RE: [PHP] Reg Exp Help

2002-01-25 Thread Zach Curtis
, it's variable. Zach -Original Message- From: Edward van Bilderbeek - Bean IT [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 9:58 AM To: Zach Curtis Subject: Re: [PHP] Reg Exp Help how can I see that it isn't a 6 char $password with a 3 char $int_id ?? > Thi

Re: [PHP] Reg. Exp. Help

2001-02-13 Thread Christian Reiniger
On Tuesday 13 February 2001 04:59, Scott Mebberson wrote: > I think that maybe preg_match() or preg_match_all() is the answer but I > have know idea on how to make the regular expression I am using perl > comptaible. > > Here it is: > $txt = ereg_replace("src=\"([^>]+)\.(gif|jpg)\"", > "src=\"http

Re: [PHP] Reg. Exp. Help

2001-02-12 Thread Scott Mebberson
I really need help with this. I have written a regular expression that searches for any occurance of src="*" in a html page and rewrites it so that it is equal to src="http://www.whereever.com/images/filename.jpg" - If there are five occurances of this match then it replaces them all. Is th