[PHP] Re: Regex help

2008-09-09 Thread Nathan Rixham
Jason Pruim wrote: Hey everyone, Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match purl.schreurprinting.com/jasonpruim112 to purl.schreurprinting.com/p.php?purl=jasonpruim112 Here are my current matching patterns:

Re: [PHP] Re: Regex help

2008-09-09 Thread Jason Pruim
On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote: Jason Pruim wrote: Hey everyone, Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match purl.schreurprinting.com/jasonpruim112 to purl.schreurprinting.com/p.php?purl=jasonpruim112

Re: [PHP] Re: Regex help

2008-09-09 Thread Nathan Rixham
Jason Pruim wrote: On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote: Jason Pruim wrote: Hey everyone, Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match purl.schreurprinting.com/jasonpruim112 to

Re: [PHP] Re: Regex help

2008-09-09 Thread Per Jessen
Jason Pruim wrote: On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote: Jason Pruim wrote: Hey everyone, Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match purl.schreurprinting.com/jasonpruim112 to

Re: [PHP] Re: Regex help

2008-09-09 Thread Jason Pruim
On Sep 9, 2008, at 5:02 PM, Nathan Rixham wrote: Jason Pruim wrote: On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote: Jason Pruim wrote: Hey everyone, Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match

Re: [PHP] Re: Regex help

2008-09-09 Thread Jochem Maas
Jason Pruim schreef: On Sep 9, 2008, at 5:02 PM, Nathan Rixham wrote: Jason Pruim wrote: On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote: Jason Pruim wrote: Hey everyone, Not completely specific to php but I know you guys know regex's better then I do! :) I am attempting to match

Re: [PHP] Re: Regex help

2008-09-09 Thread Jason Pruim
On Sep 9, 2008, at 12:18 PM, Jochem Maas wrote: Jason Pruim schreef: On Sep 9, 2008, at 5:02 PM, Nathan Rixham wrote: Jason Pruim wrote: On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote: Jason Pruim wrote: Hey everyone, Not completely specific to php but I know you guys know regex's

Re: [PHP] Re: Regex help

2008-09-09 Thread Jochem Maas
Jason Pruim schreef: On Sep 9, 2008, at 12:18 PM, Jochem Maas wrote: ... I'll have to do some searching :) always ;-) The problem with the internet is there is so much out there... Trying to weed the crap from the food can be a long digestive process which ends up with MORE crap

[PHP] Re: REGEX Help Please

2005-09-19 Thread Mark Rees
I am trying to implement a regular expression so that I have a number between 0.00 and 1.00. the following works except I can go up to 1.99 $regexp = /^[0-1]{1}.[0-9]{2}/; You could always do this, unless you are set on using a regular expression: if($num=0 $num=1.01){ echo

[PHP] Re: Regex help

2005-06-06 Thread Al
RaTT wrote: Hi Guys, I am currently creating a once off text parser for a rather large document that i need to strip out bits of information on certain lines. The line looks something like : Adress line here, postcode, country Tel: +27 112233665 Fax: 221145221 Website:

[PHP] Re: Regex help

2005-01-28 Thread Stian Berger
On Fri, 28 Jan 2005 14:59:29 -0700, [EMAIL PROTECTED] wrote: OK, this is off-topic like every other regex help post, but I know some of you enjoy these puzzles :) I need a validation regex that will pass a string. The string can be no longer than some maximum length, and it can contain any

[PHP] Re: regex help and file question

2004-08-07 Thread Torsten Roehr
Php Gen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I am just starting out with regex (and classes) so am not sure how to do this... I am seeing if a HTML file exists, if yes, I am using file_get_contents to get the entire HTML file into a string. In the HTML file I

Re: [PHP] Re: regex help and file question

2004-08-07 Thread PHP Gen
Hi, I can't answer your regexp question but some thoughts on file() etc.: - file() returns the contents line by line as an array, so this makes only sense if you need the contents in this form, e.g. for looping through each line and applying a function or whatever - fread() requires a

Re: [PHP] Re: regex help needed -- Solved! Thanks!

2004-08-02 Thread Fabrice Lezoray
Message- From: Fabrice Lezoray [mailto:[EMAIL PROTECTED] Sent: Sunday, August 01, 2004 2:52 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: regex help needed hi M. Sokolewicz a écrit : You could try something like: $return = preg_replace('#h[1-9](.*)/h[1-9]#Uie', 'str_replace(br /, , $1

[PHP] Re: regex help needed

2004-08-01 Thread M. Sokolewicz
You could try something like: $return = preg_replace('#h[1-9](.*)/h[1-9]#Uie', 'str_replace(br /, , $1)'); - Tul Kathleen Ballard wrote: Sorry, Here is the code I am using to match the h* tags: h([1-9]){1}.*/h([1-9]){1} I have removed all the NL and CR chars from the string I am matching to make

[PHP] Re: regex help needed

2004-08-01 Thread Fabrice Lezoray
hi M. Sokolewicz a écrit : You could try something like: $return = preg_replace('#h[1-9](.*)/h[1-9]#Uie', 'str_replace(br /, , $1)'); - Tul Kathleen Ballard wrote: Sorry, Here is the code I am using to match the h* tags: h([1-9]){1}.*/h([1-9]){1} I think this mask is better :

RE: [PHP] Re: regex help needed -- Solved! Thanks!

2004-08-01 Thread Kathleen Ballard
and the '#'? What are 'Uie' and 'sie'? Thanks again! Kathleen -Original Message- From: Fabrice Lezoray [mailto:[EMAIL PROTECTED] Sent: Sunday, August 01, 2004 2:52 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: regex help needed hi M. Sokolewicz a écrit : You could try something like

Re: [PHP] Re: Regex Help

2004-01-27 Thread karthikeyan.balasubramanian
: Monday, January 26, 2004 11:56 PM Subject: [PHP] Re: Regex Help Check the PHP manual for preg_match() (http://us3.php.net/manual/en/function.preg-match.php). I did play around with it a little bit, and I think I've got a starting point for you to work with. Try out this code and then play

Re: [PHP] Re: Regex Help

2004-01-27 Thread Ben Ramsey
Why do you need to remove the delimeters? If you remove them, then it makes it quite difficult to get the data you need. If you want to display the date and race type without the square brackets around them, then use $matches[0][1] and $matches[1][1] instead of $matches[0][0] or

[PHP] Re: Regex Help

2004-01-26 Thread Ben Ramsey
Check the PHP manual for preg_match() (http://us3.php.net/manual/en/function.preg-match.php). I did play around with it a little bit, and I think I've got a starting point for you to work with. Try out this code and then play around with it to get the results you need. $matches[2][0] will

[PHP] Re: Regex help please

2004-01-11 Thread Manuel Vázquez Acosta
Try this: $pattern = '#function (\w+)\(((?:\$\w+(?:,\s*\$\w+)*?)|\s*)\)\s*\{[.\s]*((?:return\s+[^;]*\s*;)|)[ .\s]*#m'; Notice that \w means: A word character is any letter or digit or the underscore character, that is, any character which can be part of a Perl word. Though, any regexp for this

[PHP] Re: RegEx -- help

2003-10-10 Thread Curt Zirzow
On Fri, 10 Oct 2003 14:01:00 -0400 (EDT), Lists [EMAIL PROTECTED] wrote: I do not know if this is the right list, but if someone could help me with the following Sure, I'll be glad to help. I need a function that does this: I'm not sure if you want me to write the code that does this for you,

Re: [PHP] Re: RegEx -- help

2003-10-10 Thread Robert Cummings
On Fri, 2003-10-10 at 16:18, Curt Zirzow wrote: On Fri, 10 Oct 2003 14:01:00 -0400 (EDT), Lists [EMAIL PROTECTED] wrote: I do not know if this is the right list, but if someone could help me with the following Sure, I'll be glad to help. I need a function that does this: I'm

[PHP] Re: regex help?

2003-07-21 Thread sven
hi john, try a regex like this: '/td[^]*(.*)/td/i' ciao SVEN John Herren wrote: Can't seem to get this to work... trying to yank stuff xxx from TD class=a8b noWrap align=middle width=17 bgColor=#ccxxx/TD and stuff yyy from TD class=a8b noWrap width=100nbsp;yyy/TD

[PHP] Re: Regex help needed

2003-07-16 Thread Nomadeous
First, the prob you got : WARNING comes from the following error: (\s+face=\Verdana, Arial, Helvetica, sans-serif\|) After the | (OR) sign, you must define another case, example: echo eregi_replace (tr bgcolor=\#F8F8F1\(\s*)td\s*font size=\2\(\s+face=\Verdana, Arial, Helvetica,

[PHP] Re: Regex Help with - ?

2003-06-27 Thread sven
looks like id3v2 ;-) how about this: $string = [TIT2] ABC [TPE1] GHI [TALB] XYZ; $pattern = /\[TIT2\]([^]*)/; // matches anything exept ''; till '' or end of string preg_match($pattern, $string, $match); var_export($match); hint to your regex: either use quantifier '*' (0-n times) OR '?' (0-1

Re: [PHP] Re: Regex Help with - ?

2003-06-27 Thread Gerard Samuel
sven wrote: looks like id3v2 ;-) how about this: $string = [TIT2] ABC [TPE1] GHI [TALB] XYZ; $pattern = /\[TIT2\]([^]*)/; // matches anything exept ''; till '' or end of string preg_match($pattern, $string, $match); var_export($match); Yeah, Im trying to figure out a way to parse these tags. --

[PHP] Re: regex help

2002-09-05 Thread Richard Lynch
?php $str = 'hi bmy friend/b! br / this message uses html entities a href=http://www.trini0.org;test/a!'; $str = preg_replace('/(a href=http:\/\/.*.*\/a)/', htmlspecialchars($1), $str); Maybe I'm missing something here, but can't you just do: $str = htmlspecialchars($str); -- Like Music?

[PHP] Re: Regex help

2001-08-22 Thread Robin Vickery
[EMAIL PROTECTED] (Stefen Lars) writes: In the Apache config file, we have the following directive: SetEnvIfNoCase Referer ^http://www.oursite.com/; local_ref=1 FilesMatch .(gif|jpg) Order Allow,Deny Allow from env=local_ref /FilesMatch We use this to prevent people from