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

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

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:, On 12/29

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: > Dear List - > > Th

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 >

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

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 l

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. > > > > On Aug 13, 2008, at 3:07

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

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

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

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

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

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

2004-08-02 Thread Fabrice Lezoray
Kathleen Ballard a écrit : Thanks! Works like a charm! I am the very lowest of newbies when it comes to regex and working through your solutions has been very educational. I have one question about something I couldn't figure out: #(.*)#Uie `.*?`sie What is the purpose of the back-ticks and the

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

2004-08-01 Thread Kathleen Ballard
Thanks! Works like a charm! I am the very lowest of newbies when it comes to regex and working through your solutions has been very educational. I have one question about something I couldn't figure out: #(.*)#Uie `.*?`sie What is the purpose of the back-ticks and the '#'? What are 'Uie' and

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
Hi Ben, Your code works but If i remove the delimter [] which I gave so that you could capture the data which needs to be picked it doesnt work?. Any help? Karthikeyan B - Original Message - From: "Ben Ramsey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Karthikeyan" <[EMAIL PROTECTED

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

RE: [PHP] Re: regex problem

2003-08-15 Thread Wouter van Vliet
So, what you want is to pretty much use this regex /^(.*)([^\/]+)\/([^\/]+)$/ when matched on this URI, the backreferences will contain \\1 partner/ \\2 name \\3 contact.html \\4 .html > > partner/name/contact.html I have not tested it, but I just guess it will work ;) Wanna kn

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

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

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

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

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 {

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 t

Re: [PHP] Re: Regex for Browser Versions

2003-06-06 Thread Gerard Samuel
True, but since the code is being run by 3rd parties, I don't have a guarantee that the browsecap.ini file is available on the server. Monty wrote: Maybe it might be easier to just use the get_browser() function: http://www.php.net/manual/en/function.get-browser.php Monty -- PHP General Mai

RE: [PHP] Re: regex problem

2003-06-03 Thread Ford, Mike [LSS]
> -Original Message- > From: Monty [mailto:[EMAIL PROTECTED] > Sent: 31 May 2003 21:21 > > If you want the entire string to be tested for digits, you > need to add the > length of the string to the regex pattern: > > $length = strlen($data); > preg_match("[0-9]{$length}", $data);

Re: [PHP] Re: regex problem

2003-06-01 Thread Daniel J. Rychlik
I had no idea their was a is_numeric function(). Ill check it out. Its probably a lot better to use then trying to preg_match()/ Many thanks - Original Message - From: "Monty" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, May 31, 2003 3:21 PM Subject: [PHP] Re: regex probl

Re: [PHP] Re: REGEX for phone #

2002-07-29 Thread Analysis & Solutions
Hi Richard: On Mon, Jul 29, 2002 at 05:02:49AM -0500, Richard Lynch wrote: > > For starters, if Perl wants \ PHP needs \\ since \ is special in both > languages. I'm curiuos what you're talking about. The manual says nothing about this in the PCRE section: Example 1. Examples of valid patte