Re: [PHP] Re: Regex

2012-07-27 Thread Al
On 7/27/2012 2:56 PM, David Harkness wrote: On Fri, Jul 27, 2012 at 11:43 AM, Al wrote: "%[\w\d,.]%" "\w" will match digits so "\d" isn't necessary, but it will also match underscores which isn't desired. David You're correct, I forgot about the darn _ and \w includes digits So, how's

Re: [PHP] Re: Regex

2012-07-27 Thread David Harkness
On Fri, Jul 27, 2012 at 11:43 AM, Al wrote: > "%[\w\d,.]%" > "\w" will match digits so "\d" isn't necessary, but it will also match underscores which isn't desired. David

[PHP] Re: Regex

2012-07-27 Thread Al
On 7/27/2012 1:07 PM, Ethan Rosenberg wrote: Dear list - I've tried everything and am still stuck. A regex that will accept numbers, letters, comma, period and no other characters Thanks. Ethan Rosenberg "%[\w\d,.]%" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-07 Thread Shawn McKenzie
On 03/05/2011 04:38 PM, Mark Kelly wrote: > Hi. > > Thanks for all the replies. > > On Saturday 05 Mar 2011 at 22:11 Simon J Welsh wrote: > >> On 6/03/2011, at 11:08 AM, Shawn McKenzie wrote: >>> $regex = '/"([^"]+)"/'; > > Shawn, this regex gets me two copies of each string - one with and one

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Shuo
Maybe this will help. $regex = '/(?<=")[^.]*(?=")/'; $r = preg_match_all($regex, $sentence, $phrases);

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Mark Kelly
Hi. Thanks for all the replies. On Saturday 05 Mar 2011 at 22:11 Simon J Welsh wrote: > On 6/03/2011, at 11:08 AM, Shawn McKenzie wrote: > > $regex = '/"([^"]+)"/'; Shawn, this regex gets me two copies of each string - one with and one without the double quotes - as did the one Nathan posted e

Re: [PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Simon J Welsh
On 6/03/2011, at 11:08 AM, Shawn McKenzie wrote: > On 03/05/2011 09:26 AM, Mark Kelly wrote: >> Hi. >> >> I'm hoping someone can help me extract text between double quotes from a >> string. >> >> $regex = 'some magic'; >> $r = preg_match($regex, $sentence, $phrases); >> >> So, if >> >> $sen

[PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Shawn McKenzie
On 03/05/2011 09:26 AM, Mark Kelly wrote: > Hi. > > I'm hoping someone can help me extract text between double quotes from a > string. > > $regex = 'some magic'; > $r = preg_match($regex, $sentence, $phrases); > > So, if > > $sentence = 'Dave said "This is it". "Nope, that is the wrong colour

[PHP] Re: Regex for extracting quoted strings

2011-03-05 Thread Nathan Rixham
Mark Kelly wrote: Hi. I'm hoping someone can help me extract text between double quotes from a string. $regex = 'some magic'; $r = preg_match($regex, $sentence, $phrases); So, if $sentence = 'Dave said "This is it". "Nope, that is the wrong colour" she replied.'; I want $phrases to cont

[PHP] Re: Regex for ... genealogical names

2011-01-01 Thread Al
On 1/1/2011 4:46 AM, Lester Caine wrote: JohnDoeSMITH' or 'John Doe SMITH' Try this. not tested. First, which adds spaces as needed. e.g. JohnDoeSMITH > 'John Doe SMITH' $newName=preg_replace("%(?<=[a-z])([A-Z])", " $1", $name);//Cap following low case, add space before it Next, alphas fol

Re: [PHP] Re: Regex for telephone numbers

2010-12-31 Thread Per Jessen
Al wrote: > > > On 12/29/2010 7:12 PM, Ethan Rosenberg wrote: >> Dear List - >> >> Thank you for all your help in the past. >> >> Here is another one >> >> I would like to have a regex which would validate that a telephone >> number is in the format xxx-xxx-. >> >> Thanks. >> >> Ethan >>

Re: [PHP] Re: Regex for telephone numbers

2010-12-31 Thread Al
On 12/31/2010 11:10 AM, a...@ashleysheridan.co.uk wrote: Erm, you say regex is overkill, then use one in your example! Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: "Al" Date: Fri, Dec 31, 2010 15:53 Subject: [PHP] Re: Regex for telephone numbers To:

Re: [PHP] Re: Regex for telephone numbers

2010-12-31 Thread a...@ashleysheridan.co.uk
Erm, you say regex is overkill, then use one in your example! Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: "Al" Date: Fri, Dec 31, 2010 15:53 Subject: [PHP] Re: Regex for telephone numbers To: , On 12/29/2010 7:12 PM, Ethan Rosenberg wrote: &

[PHP] Re: Regex for telephone numbers

2010-12-31 Thread Al
On 12/29/2010 7:12 PM, Ethan Rosenberg wrote: Dear List - Thank you for all your help in the past. Here is another one I would like to have a regex which would validate that a telephone number is in the format xxx-xxx-. Thanks. Ethan MySQL 5.1 PHP 5 Linux [Debian (sid)] Regex i

Re: [PHP] Re: Regex Problem

2009-07-31 Thread Shawn McKenzie
Shawn McKenzie wrote: > Igor Escobar wrote: >> No no, i need to make an regex to "match" the bold areas in my string. >> Anything between single quotes or double quotes (including quotes and >> double quotes). Understand? >> >> >> Regards, >> Igor Escobar >> Systems Analyst & Interface Designer >>

Re: [PHP] Re: Regex Problem

2009-07-31 Thread Shawn McKenzie
Igor Escobar wrote: > No no, i need to make an regex to "match" the bold areas in my string. > Anything between single quotes or double quotes (including quotes and > double quotes). Understand? > > > Regards, > Igor Escobar > Systems Analyst & Interface Designer > > + http://blog.igorescobar.com >

[PHP] Re: Regex Problem

2009-07-31 Thread Shawn McKenzie
Igor Escobar wrote: > The solution don't need to be with regex, if anyone can solve this with > other way will be very helpfull . > > > Regards, > Igor Escobar > Systems Analyst & Interface Designer > > + http://blog.igorescobar.com > + http://www.igorescobar.com > + @igorescobar (twitter) > >

[PHP] Re: Regex Problem

2009-07-31 Thread Igor Escobar
The solution don't need to be with regex, if anyone can solve this with other way will be very helpfull . Regards, Igor Escobar Systems Analyst & Interface Designer + http://blog.igorescobar.com + http://www.igorescobar.com + @igorescobar (twitter) On Fri, Jul 31, 2009 at 2:23 PM, Igor Esco

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 comin

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 bett

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 purl.sch

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 purl.schreurprinting.com/jaso

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 >>> purl.schreurpr

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 purl.schreurprinting.com/p.php?purl=j

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 Here

[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

2008-08-13 Thread Philip Thompson
On Aug 13, 2008, at 4:06 PM, Boyd, Todd M. wrote: -Original Message- From: Shawn McKenzie [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2008 3:31 PM To: php-general@lists.php.net Subject: [PHP] Re: regex Philip Thompson wrote: Figured it out. Just needed to stretch my brain a

Re: [PHP] Re: regex

2008-08-13 Thread Philip Thompson
On Aug 13, 2008, at 3:31 PM, Shawn McKenzie wrote: Philip Thompson wrote: Figured it out. Just needed to stretch my brain a lil. On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote: $pattern = '/(.*).php\?action=([^&]+)+/'; preg_match ($pattern, $subject, $matches); return $matches; } blegh

RE: [PHP] Re: regex

2008-08-13 Thread Boyd, Todd M.
> -Original Message- > From: Shawn McKenzie [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 13, 2008 3:31 PM > To: php-general@lists.php.net > Subject: [PHP] Re: regex > > Philip Thompson wrote: > > Figured it out. Just needed to stretch my brain a lil. &g

[PHP] Re: regex

2008-08-13 Thread Shawn McKenzie
Philip Thompson wrote: Figured it out. Just needed to stretch my brain a lil. On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote: $pattern = '/(.*).php\?action=([^&]+)+/'; preg_match ($pattern, $subject, $matches); return $matches; } blegh ('somePage.php?action=doSomething&id='); ?> O

Re: [PHP] Re: regex

2008-08-13 Thread Micah Gersten
Take a look at this function, it'll make things a little easier: http://us3.php.net/manual/en/function.parse-str.php Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Philip Thompson wrote: > Figured it out. Just needed to stretch my brain a lil. > > On Aug 13

[PHP] Re: regex

2008-08-13 Thread Philip Thompson
Figured it out. Just needed to stretch my brain a lil. On Aug 13, 2008, at 3:07 PM, Philip Thompson wrote: $pattern = '/(.*).php\?action=([^&]+)+/'; preg_match ($pattern, $subject, $matches); return $matches; } blegh ('somePage.php?action=doSomething&id='); ?> Ok, the important parts t

[PHP] Re: Regex in PHP

2008-06-04 Thread Shawn McKenzie
VamVan wrote: Hello All, For example I have these email addressess - [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] What would be my PHP function[Regular expression[ to that can give me some thing like yahoo.com hotmail.com gmail.com Thanks Or if you know that the address is valid

[PHP] Re: Regex in PHP

2008-06-04 Thread Al
$user = trim(strstr($email, '@'), '@); VamVan wrote: Hello All, For example I have these email addressess - [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] What would be my PHP function[Regular expression[ to that can give me some thing like yahoo.com hotmail.com gmail.com Thanks

[PHP] Re: Regex for Advanced search feature

2007-10-19 Thread Al
Go here and get charprobe http://www.dextronet.com/charprobe.php It's a super utility to have. Look up the hex code for a space, "/x20" as I recall. Then pick a non-printable code that you like e.g., /x83 or a printable one that users cannot enter. Then simply preg_replace("%/x20+%", "/83",

Re: [PHP] re regex error

2007-03-14 Thread Jim Lucas
jekillen wrote: Hello again; Regarding the error I was inquiring about: Warning: ereg() [function.ereg]: REG_ERANGE in _proc.php on line 81 I still would like to know what it means but I solved the script problem. I found that since $groups is a string that was exploded to form the $g_lis

[PHP] re regex error

2007-03-14 Thread jekillen
Hello again; Regarding the error I was inquiring about: Warning: ereg() [function.ereg]: REG_ERANGE in _proc.php on line 81 I still would like to know what it means but I solved the script problem. I found that since $groups is a string that was exploded to form the $g_list array it may ha

[PHP] Re: Regex error

2007-03-14 Thread Al
Get The Regex Coach http://weitz.de/regex-coach/ Use preg_match_all() Build your pattern one step at a time using the coach. Don't forget the delimiters. jekillen wrote: Hello; The following regex: ereg("id='$m[1]'>", $groups, $m1); is causing the following error: Warning: ereg() [functi

[PHP] Re: Regex

2006-08-22 Thread Nadim Attari
M. Sokolewicz wrote: Nadim Attari wrote: Hello, I have some text in a table... the text contains hyperlinks (but not html coded, i.e. plain "Some text...http://www.something.com";) When i retrieve these texts from the table, i want the hyperlinks to become clickable, i.e. "Some text...hre

Re: [PHP] Re: Regex

2006-08-21 Thread J R
http://www.php.net/manual/en/reference.pcre.pattern.syntax.php On 8/22/06, Alex Turner <[EMAIL PROTECTED]> wrote: If what you mean is a db table, then it would seem to me that you should not be using a regex. PHP has rawurlencode() for this sort of thing. But - you should learn regex ;-) Try

[PHP] Re: Regex

2006-08-21 Thread Alex Turner
If what you mean is a db table, then it would seem to me that you should not be using a regex. PHP has rawurlencode() for this sort of thing. But - you should learn regex ;-) Try something like (untested and late at night) function urlme($location) { $enc=rawurlencode($location); $spc

Re: [PHP] Re: Regex

2006-08-21 Thread Dave Goodchild
On 21/08/06, M. Sokolewicz <[EMAIL PROTECTED]> wrote: A little harsh but I agree with the sentiment - plus you will get a lot of pleasure out of it when you see how powerful a tool it is in your arsenal. -- http://www.web-buddha.co.uk http://www.projectkarma.co.uk

[PHP] Re: Regex

2006-08-21 Thread M. Sokolewicz
Nadim Attari wrote: Hello, I have some text in a table... the text contains hyperlinks (but not html coded, i.e. plain "Some text...http://www.something.com";) When i retrieve these texts from the table, i want the hyperlinks to become clickable, i.e. "Some text...href="http://www.somethin

[PHP] Re: Regex

2006-08-21 Thread Ivo F.A.C. Fokkema
On Mon, 21 Aug 2006 13:51:16 +0400, Nadim Attari wrote: > Hello, > > I have some text in a table... the text contains hyperlinks (but not > html coded, i.e. plain "Some text...http://www.something.com";) > > When i retrieve these texts from the table, i want the hyperlinks to > become clickabl

[PHP] Re: RegEx drop everything after last pattern

2005-12-23 Thread Al
John Nichel wrote: Okay, maybe it's just the fact that I'm concentration on getting out of here for the holidays more than I am on my work, but I'm pulling my hair out. Say I have a string - Now, is the time; for all good men! to come to the aide? of their What I want to do is drop everythin

[PHP] Re: Regex for balanced brackets?

2005-11-22 Thread Al
Jeffrey Sambells wrote: I came across this method of matching brackets with regex in .NET http://puzzleware.net/blogs/archive/2005/08/13/22.aspx but I am wondering if it is possible to do the same in PHP? I've tried it a bit but I can't seem to get it to work properly. I'm just wondering if

[PHP] Re: regex and global vars problem

2005-10-27 Thread Al
Jason Gerfen wrote: I am having a problem with a couple of function I have written to check for a type of string, attempt to fix it and pass it back to the main function. Any help is appreciated. if( ( eregi( "^[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[0-9A-Fa-f]{2}\:[

[PHP] Re: RegEx - Is this right?

2005-10-16 Thread Oliver Grätz
I don't know if these are equal. What about \r\n line endings? And what about \r line endings (from old Macs)? I guess file() handles all of these cases (didn't test it though) and your code doesn't (with \r you'll get a one line file!). AllOlli -- PHP General Mailing List (http://www.php.net/)

[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 numb

[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: http://www.urlhere.co

[PHP] RE: regex question

2005-05-17 Thread Carl Furst
I think there maybe a few ways to do this... One is [EMAIL PROTECTED]@[EMAIL PROTECTED] That basically says "find me the pattern where one non-at symbol is followed by an at symbol followed by another non-at symbol" So if you do numMatch: 3 Array ( [0] => Array ( [0]

[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 ch

[PHP] Re: Regex Parsing

2004-12-05 Thread M. Sokolewicz
[EMAIL PROTECTED] wrote: preg_match_all('#\[LEVEL([0-9])\](.*)\[/LEVEL[0-9]]#Uim', $content, $matches); You make it look so easy, thanks! That takes care of step one, but how do I make it so everything in $content where there is a level set, is replaced with ###LEVEL?### Does #Uim tell it to only

[PHP] Re: Regex Parsing

2004-12-05 Thread [ rswfire ]
> preg_match_all('#\[LEVEL([0-9])\](.*)\[/LEVEL[0-9]]#Uim', $content, $matches); You make it look so easy, thanks! That takes care of step one, but how do I make it so everything in $content where there is a level set, is replaced with ###LEVEL?### Does #Uim tell it to only get the first [/LEVE

[PHP] Re: Regex Parsing

2004-12-05 Thread M. Sokolewicz
[EMAIL PROTECTED] wrote: I wish to improve upon my regular expression skills. I am creating a journal object that allows me to post my journals online, while at the same time maintaining nine different levels of privacy. For example, if I give a user Level 3 access, then they would be able to see

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() re

[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

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

2004-08-02 Thread Fabrice Lezoray
-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: $return = preg_replace('#(.*)#Uie', 'str_replace(&q

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

2004-08-01 Thread Kathleen Ballard
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 so

[PHP] Re: regex help needed

2004-08-01 Thread Fabrice Lezoray
hi M. Sokolewicz a écrit : You could try something like: $return = preg_replace('#(.*)#Uie', 'str_replace("", "", "$1")'); - Tul Kathleen Ballard wrote: Sorry, Here is the code I am using to match the tags: .* I think this mask is better : `.*?`sie I have removed all the NL and CR chars from the

[PHP] Re: regex help needed

2004-08-01 Thread M. Sokolewicz
You could try something like: $return = preg_replace('#(.*)#Uie', 'str_replace("", "", "$1")'); - Tul Kathleen Ballard wrote: Sorry, Here is the code I am using to match the tags: .* I have removed all the NL and CR chars from the string I am matching to make things easier. Also, I have run tidy

[PHP] Re: regex problem

2004-07-01 Thread Josh Close
Thanks, that's exactly what I was looking for. -Josh On Thu, 01 Jul 2004 15:17:41 -0700, Lars Torben Wilson <[EMAIL PROTECTED]> wrote: > > Josh Close wrote: > > > I'm trying to get a simple regex to work. Here is the test script I have. > > > > #!/usr/bin/php -q > > > > > $string = "hello\nwor

[PHP] Re: regex problem

2004-07-01 Thread Lars Torben Wilson
Josh Close wrote: I'm trying to get a simple regex to work. Here is the test script I have. #!/usr/bin/php -q $string = "hello\nworld\n"; $string = preg_replace("/[^\r]\n/i","\r\n",$string); First, the short version. You can fix this by using backreferences: $string = preg_replace("/([^\r])\n/i",

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 $matches[1][0

Re: [PHP] Re: Regex Help

2004-01-27 Thread karthikeyan.balasubramanian
"Karthikeyan" <[EMAIL PROTECTED]> Sent: 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 st

[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 hol

[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 thi

[PHP] Re: Regex to grab a Windows Path from a String...

2003-12-17 Thread Sven
[EMAIL PROTECTED] schrieb: My regex skills are serious lacking and after scouring the net for relevant links I'm a bit stuck. I've got a textarea field where I pull user input from, and I'd like to search this entire field for a Windows Directory Path (ex. C:\Documents\Blah). Basically my users ar

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 th

[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,

[PHP] Re: regex/preg_replace() difficulty

2003-10-01 Thread Jon Kriek
You need to escape the period "." twice with backslashes "\\" -- Jon Kriek http://phpfreaks.com "Jonas_weber @ Gmx . Ch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Regular Expressions: How can I indicate that the contents of a term > (user input*) needs to be treated as 'non-o

RE: [PHP] Re: regex problem

2003-08-15 Thread Wouter van Vliet
o match the last part of the url and looks up untill the end. Again a string containing no slashes Hope it does do what I expect it to do .. ;) Wouter -Oorspronkelijk bericht- Van: Merlin [mailto:[EMAIL PROTECTED] Verzonden: vrijdag 15 augustus 2003 16:21 Aan: [EMAIL PROTECTED] Onderwer

Re: [PHP] Re: regex problem

2003-08-15 Thread Curt Zirzow
* Thus wrote Kae Verens ([EMAIL PROTECTED]): > Jay Blanchard wrote: > >if($string == 'test/contact.html') > > >it could be > > > >if($string == "test/contact.html") > > not to start a flame war or anything, but isn't the apostrophe version > quicker, as it doesn't ask the server to parse the str

Re: [PHP] Re: regex problem

2003-08-15 Thread Curt Zirzow
* Thus wrote Merlin ([EMAIL PROTECTED]): > ufff.. sorry guys, but I have to explain that better. I appreciate your > help, maybe I did not give enough info. > > I am trying to redirect with apache modrewrite. To do this you have to use > regex (not if functions:-) I'm not sure what you expect sin

[PHP] Re: regex problem

2003-08-15 Thread Merlin
Good idea, but does not work either - surprisingly! - There should be a clean way with regex for this task. Andy regex expert in here? Merlin "Kae Verens" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Merlin wrote: > > ufff.. sorry guys, but I have to explain that bett

Re: [PHP] Re: regex problem

2003-08-15 Thread Merlin
does not work. Is there not a way to exclude the word "partner" like you triede with !(partner) ? merlin "Marek Kilimajer" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > So > ^[^/]+/[^/]* > > or > > ^!(partner/) > > Merlin wrote: > > > ufff.. sorry guys, but I have to expla

Re: [PHP] Re: regex problem

2003-08-15 Thread Marek Kilimajer
So ^[^/]+/[^/]* or ^!(partner/) Merlin wrote: ufff.. sorry guys, but I have to explain that better. I appreciate your help, maybe I did not give enough info. I am trying to redirect with apache modrewrite. To do this you have to use regex (not if functions:-) My problem is, that there are member

[PHP] Re: regex problem

2003-08-15 Thread Kae Verens
Merlin wrote: ufff.. sorry guys, but I have to explain that better. I appreciate your help, maybe I did not give enough info. I am trying to redirect with apache modrewrite. To do this you have to use regex (not if functions:-) My problem is, that there are member accounts which look like that: me

Re: [PHP] Re: regex problem

2003-08-15 Thread Kae Verens
Jay Blanchard wrote: if($string == 'test/contact.html') it could be if($string == "test/contact.html") not to start a flame war or anything, but isn't the apostrophe version quicker, as it doesn't ask the server to parse the string? Kae -- PHP General Mailing List (http://www.php.net/) To unsu

[PHP] Re: regex problem

2003-08-15 Thread Merlin
ufff.. sorry guys, but I have to explain that better. I appreciate your help, maybe I did not give enough info. I am trying to redirect with apache modrewrite. To do this you have to use regex (not if functions:-) My problem is, that there are member accounts which look like that: membername/con

RE: [PHP] Re: regex problem

2003-08-15 Thread Jay Blanchard
[snip] > if($string = 'test/contact.html') That's if($string == 'test/contact.html') of course... :) [/snip] it could be if($string == "test/contact.html") couldn't resist :) Jay P.S. John, nothing on that thing yet. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re: regex problem

2003-08-15 Thread John W. Holmes
John W. Holmes wrote: Merlin wrote: ^\/test\/contact.html$ does not work. I am sorry, I just found that it has to be: test/contact.html and not dir/test/contact.html there is no leading slash. Do you have any other suggestion? Are you making this too hard? if($string = 'test/contact.html')

[PHP] Re: regex problem

2003-08-15 Thread Kae Verens
Merlin wrote: ^\/test\/contact.html$ does not work. I am sorry, I just found that it has to be: test/contact.html and not dir/test/contact.html there is no leading slash. Do you have any other suggestion? *sigh* ^test\/contact.html$ Kae -- PHP General Mailing List (http://www.php.net/) To u

Re: [PHP] Re: regex problem

2003-08-15 Thread John W. Holmes
Merlin wrote: ^\/test\/contact.html$ does not work. I am sorry, I just found that it has to be: test/contact.html and not dir/test/contact.html there is no leading slash. Do you have any other suggestion? Are you making this too hard? if($string = 'test/contact.html') { echo 'good'; } else {

[PHP] Re: regex problem

2003-08-15 Thread Merlin
> ^\/test\/contact.html$ does not work. I am sorry, I just found that it has to be: test/contact.html and not dir/test/contact.html there is no leading slash. Do you have any other suggestion? --