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=\

[PHP] Reg Exp.

2004-08-18 Thread John Legg
To start with try replacing: $patterns[1] = "//"; with $patterns[1] = "/<\/strike>/"; Rgds John --- Hi! Why can´t 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 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;\""; > >

[PHP] Reg Exp.

2004-08-18 Thread Jay
Hi! 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); Thanx

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);

[PHP] reg exp for smtp error codes

2004-04-23 Thread Robert Kornfeld
hey professionals out there! does anybody have a script that parses the error-code from a returned email-header (esmtp)? thanx! Robby -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

[PHP] Reg Exp help needed

2003-06-24 Thread Sparky Kopetzky
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. 2nd: $goodbadnum =~ tr/0-9/x/; I think this one replaces and numbers with an 'x'. Right, wr

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);

[PHP] reg exp matching/replacing

2002-10-02 Thread Jennifer Swofford
I'm getting much closer to achieving my goal here. Now, I'm missing yet one more element. Here is my code: -- $filename = "newexample.html"; $fd = fopen ($filename, "r"); $contents = fread ($fd, filesize ($filename)); preg_match_all('{\/*[A-z0-9_/-]+(.gif|.jpg)}', $contents, $matche

[PHP] reg exp and basename help?

2002-10-01 Thread Jennifer Swofford
I need help with some regular expression matching. Here is what I am doing. In one php file, I'm reading in the contents of an html file. Both reside on the same server. What I need to do is change all image tags that are like this: To this: I know that "basename" works if you have somet

RE: [PHP] Reg Exp issue

2002-09-20 Thread Thoenen, Peter Mr. EPS
CLR 1\.0\.4725\)'); -Peter > -Original Message- > From: Taylor York [mailto:[EMAIL PROTECTED]] > Sent: Saturday, September 21, 2002 00:17 > To: [EMAIL PROTECTED] > Subject: [PHP] Reg Exp issue > > > Hello, I am trying to find a string in another string with > mysql

[PHP] Reg Exp issue

2002-09-20 Thread Taylor York
Hello, I am trying to find a string in another string with mysql. Normally, this would work. select 'foo' REGEXP ('foo'); And that would simply return 1, since it found it. But, my strings are more complicated than that. One good random example is something like this..Ya i know, its wierd but g

[PHP] Reg exp help

2002-08-30 Thread Victor Spång Arthursson
Hi! I need some help with a reg exp… I'm building a little viewer for my http access logs, and what i'ld like to do is to clean it from alla hits from my own ip… Take for example: 194.236.30.24 - - [30/Aug/2002:11:46:29 +0200] "GET /bildgalleri/createjpg.php?url=/v044&file=v044_27.jpg HTT

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

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

2002-07-25 Thread Nicklas af Ekenstam
Hi 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 like this: X-Header-A: A string X-Header-B: Another string

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

[PHP] reg exp problems

2002-06-01 Thread Andrew Brampton
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("","",$fdata); But its stripping out everything between th

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

[PHP] Reg Exp Help

2002-01-25 Thread Zach Curtis
I am trying to code a regular expression that will match at the beginning of the string the contents of $password, followed by 0 or more occurrences of white space, followed by the contents of $int_id. The match should be case insensitive. Here are some examples of the strings: This one has a 6

[PHP] reg exp help

2001-07-22 Thread Justin French
hi all, two quick reg exp problems: one: $username must only contain a-z lowercase, 0-9, no spaces, no other characters. what would the regexp be? if(ereg("", $username)) { $valid = "yes" } else { $valid = "no") two: i want to do a really small email validation, just to make s

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

[PHP] Reg. Exp. Help

2001-02-12 Thread Scott Mebberson
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 there anyway to make it only run once.