Re: [PHP] Regular Expression

2011-11-07 Thread Richard Quadling
On 5 November 2011 05:39, Negin Nickparsa wrote: > your welcome my Friend,I used it myself. > > On 11/4/11, drive view wrote: > > Thanks alot Negin for the prompt reply. This is most useful. > > > > Regards > > > > Best Toni > > > > On Sat, Nov 5, 2011 at 6:30 AM, Negin Nickparsa > wrote: > >

Re: [PHP] Regular Expression

2011-11-04 Thread Negin Nickparsa
your welcome my Friend,I used it myself. On 11/4/11, drive view wrote: > Thanks alot Negin for the prompt reply. This is most useful. > > Regards > > Best Toni > > On Sat, Nov 5, 2011 at 6:30 AM, Negin Nickparsa wrote: > >> http://weblogtoolscollection.com/regex/regex.php >> >> On 11/4/11, driv

Re: [PHP] Regular Expression

2011-11-04 Thread drive view
Thanks alot Negin for the prompt reply. This is most useful. Regards Best Toni On Sat, Nov 5, 2011 at 6:30 AM, Negin Nickparsa wrote: > http://weblogtoolscollection.com/regex/regex.php > > On 11/4/11, drive view wrote: > > Hi > > > > I'm new to PHP. I'm currently trying understand how to ap

Re: [PHP] Regular Expression

2011-11-04 Thread Negin Nickparsa
http://weblogtoolscollection.com/regex/regex.php On 11/4/11, drive view wrote: > Hi > > I'm new to PHP. I'm currently trying understand how to apply the patterns > for the preg* commands and I am having difficulty finding a good source > explaining in detail how to build a filter. I would appre

[PHP] Regular Expression

2011-11-04 Thread drive view
Hi I'm new to PHP. I'm currently trying understand how to apply the patterns for the preg* commands and I am having difficulty finding a good source explaining in detail how to build a filter. I would appreciate if someone can direct me to such a website. Thanks Toni

Re: [PHP] Regular Expression to get the whole Comma Separated String in Array Key

2010-06-30 Thread Richard Quadling
On 30 June 2010 15:12, Gaurav Kumar wrote: > Hi All, > > Need help in resolving the below problem- > > > I would like to get the whole comma separated string into an array value- > > 1. $postText = "chapters 5, 6, 7, 8"; > OR > 2. $postText = "chapters 5, 6; > OR > 3. $postText = "chapters 5, 6, 7

[PHP] Regular Expression to get the whole Comma Separated String in Array Key

2010-06-30 Thread Gaurav Kumar
Hi All, Need help in resolving the below problem- I would like to get the whole comma separated string into an array value- 1. $postText = "chapters 5, 6, 7, 8"; OR 2. $postText = "chapters 5, 6; OR 3. $postText = "chapters 5, 6, 7"; What i have done so far is- preg_match('/chapter[s]*[ ]*(\d+

Re: [PHP] regular expression

2010-06-07 Thread Ashley Sheridan
On Mon, 2010-06-07 at 22:54 +0300, Tanel Tammik wrote: > "Peter Lind" wrote in message > news:aanlktilqkz8dnc0zacfv70tctf2wqkgpzojccqtuw...@mail.gmail.com... > > On 1 June 2010 17:33, Ashley Sheridan wrote: > >> On Tue, 2010-06-01 at 16:31 +0100, Richard Quadling wrote: > >> > >>> $re1 = '/^[a-

Re: [PHP] regular expression

2010-06-07 Thread Tanel Tammik
"Peter Lind" wrote in message news:aanlktilqkz8dnc0zacfv70tctf2wqkgpzojccqtuw...@mail.gmail.com... > On 1 June 2010 17:33, Ashley Sheridan wrote: >> On Tue, 2010-06-01 at 16:31 +0100, Richard Quadling wrote: >> >>> $re1 = '/^[a-z]++$/i'; >>> $re2 = '/^[a-z ]++$/i'; >>> >>> >>> >>> -- >>> -

Re: [PHP] regular expression

2010-06-02 Thread Richard Quadling
On 2 June 2010 16:35, Jan G.B. wrote: > 2010/6/1 Peter Lind : >> On 1 June 2010 17:33, Ashley Sheridan wrote: >>> On Tue, 2010-06-01 at 16:31 +0100, Richard Quadling wrote: >>> $re1 = '/^[a-z]++$/i'; $re2 = '/^[a-z ]++$/i'; -- - Richard Quadling "S

Re: [PHP] regular expression

2010-06-02 Thread Jan G.B.
2010/6/1 Peter Lind : > On 1 June 2010 17:33, Ashley Sheridan wrote: >> On Tue, 2010-06-01 at 16:31 +0100, Richard Quadling wrote: >> >>> $re1 = '/^[a-z]++$/i'; >>> $re2 = '/^[a-z ]++$/i'; >>> >>> >>> >>> -- >>> - >>> Richard Quadling >>> "Standing on the shoulders of some very clever giants!"

Re: [PHP] regular expression

2010-06-02 Thread Richard Quadling
On 2 June 2010 06:12, Peter wrote: > Hi  Tanel, > > 1. only letters > > $str = 'helloworld'; > > if(preg_match("/^[a-zA-Z]*$/",$str)) > echo "only letters"; > else > echo "failed"; > > 2. only letters and spaces > > $str = 'hello world'; > > if(preg_match("/^[a-zA-Z\s]*$/",$str)) > echo "only lett

Re: [PHP] regular expression

2010-06-01 Thread Peter
Hi Tanel, 1. only letters $str = 'helloworld'; if(preg_match("/^[a-zA-Z]*$/",$str)) echo "only letters"; else echo "failed"; 2. only letters and spaces $str = 'hello world'; if(preg_match("/^[a-zA-Z\s]*$/",$str)) echo "only letters and spaces"; else echo "failed"; Regards Peter.M Tanel T

Re: [PHP] regular expression

2010-06-01 Thread Ashley Sheridan
On Tue, 2010-06-01 at 17:32 +0100, Richard Quadling wrote: > On 1 June 2010 16:38, Ashley Sheridan wrote: > > Ah, I ought to have guessed as it's you! ;) > > What are you insinuating? > > -- > - > Richard Quadling > "Standing on the shoulders of some very clever giants!" > EE : http://www.e

Re: [PHP] regular expression

2010-06-01 Thread Richard Quadling
On 1 June 2010 16:38, Ashley Sheridan wrote: > Ah, I ought to have guessed as it's you! ;) What are you insinuating? -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/beco

Re: [PHP] regular expression

2010-06-01 Thread Ashley Sheridan
On Tue, 2010-06-01 at 16:35 +0100, Richard Quadling wrote: > On 1 June 2010 16:33, Ashley Sheridan wrote: > > > > On Tue, 2010-06-01 at 16:31 +0100, Richard Quadling wrote: > > > > $re1 = '/^[a-z]++$/i'; > > $re2 = '/^[a-z ]++$/i'; > > > > > > > > -- > > - > > Richard Quadling > > "Standing o

Re: [PHP] regular expression

2010-06-01 Thread Peter Lind
On 1 June 2010 17:33, Ashley Sheridan wrote: > On Tue, 2010-06-01 at 16:31 +0100, Richard Quadling wrote: > >> $re1 = '/^[a-z]++$/i'; >> $re2 = '/^[a-z ]++$/i'; >> >> >> >> -- >> - >> Richard Quadling >> "Standing on the shoulders of some very clever giants!" >> EE : http://www.experts-exchang

Re: [PHP] regular expression

2010-06-01 Thread Richard Quadling
On 1 June 2010 16:33, Ashley Sheridan wrote: > > On Tue, 2010-06-01 at 16:31 +0100, Richard Quadling wrote: > > $re1 = '/^[a-z]++$/i'; > $re2 = '/^[a-z ]++$/i'; > > > > -- > - > Richard Quadling > "Standing on the shoulders of some very clever giants!" > EE : http://www.experts-exchange.com/M_

Re: [PHP] regular expression

2010-06-01 Thread Richard Quadling
On 1 June 2010 16:31, Richard Quadling wrote: > $re1 = '/^[a-z]++$/i'; ^[a-z]++$ Options: case insensitive; ^ and $ match at line breaks Assert position at the beginning of a line (at beginning of the string or after a line break character) «^» Match a single character in the range between “a

Re: [PHP] regular expression

2010-06-01 Thread Ashley Sheridan
On Tue, 2010-06-01 at 16:31 +0100, Richard Quadling wrote: > $re1 = '/^[a-z]++$/i'; > $re2 = '/^[a-z ]++$/i'; > > > > -- > - > Richard Quadling > "Standing on the shoulders of some very clever giants!" > EE : http://www.experts-exchange.com/M_248814.html > EE4Free : http://www.experts-exch

Re: [PHP] regular expression

2010-06-01 Thread Richard Quadling
$re1 = '/^[a-z]++$/i'; $re2 = '/^[a-z ]++$/i'; -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchange.com/M_248814.html EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp Zend Certified Engineer : http://zend.com/zce.php?c=ZE

Re: [PHP] regular expression

2010-06-01 Thread Ashley Sheridan
On Tue, 2010-06-01 at 18:19 +0300, Tanel Tammik wrote: > How to check with regular expression (preg) if string has: > > 1. only letters > 2. only letters and spaces > > Br > Tanel > > > Use preg_match() to find an expression within a string. You can use something like this to grab check if

Re: [PHP] regular expression

2010-06-01 Thread Adam Richardson
On Tue, Jun 1, 2010 at 11:19 AM, Tanel Tammik wrote: > How to check with regular expression (preg) if string has: > > 1. only letters > 2. only letters and spaces > > Br > Tanel > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > $

[PHP] regular expression

2010-06-01 Thread Tanel Tammik
How to check with regular expression (preg) if string has: 1. only letters 2. only letters and spaces Br Tanel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regular Expression Problem

2009-02-26 Thread Ashley Sheridan
On Thu, 2009-02-26 at 10:09 -0500, Alice Wei wrote: > Hi, > > I have two lines here as follows: > > 1 -0.123701962557954E+03 0.460967618024691E+02 > -0.12354765900E+03 0.46259109000E+02 > > What I am trying to do here is to only have > > 1 -0.123701962557954E+0

RE: [PHP] Regular Expression Problem

2009-02-26 Thread Alice Wei
Hi, I have two lines here as follows: 1 -0.123701962557954E+03 0.460967618024691E+02 -0.12354765900E+03 0.46259109000E+02 What I am trying to do here is to only have 1 -0.123701962557954E+03 0.460967618024691E+02 be the output so I can do further processin

Re: [PHP] Regular Expression Problem

2009-02-26 Thread 惠新宸
Alice Wei wrote: Hi, I have two lines here as follows: 1 -0.123701962557954E+03 0.460967618024691E+02 -0.12354765900E+03 0.46259109000E+02 What I am trying to do here is to only have 1 -0.123701962557954E+03 0.460967618024691E+02 be the output so I

[PHP] Regular Expression Problem

2009-02-26 Thread Alice Wei
Hi, I have two lines here as follows: 1 -0.123701962557954E+03 0.460967618024691E+02 -0.12354765900E+03 0.46259109000E+02 What I am trying to do here is to only have 1 -0.123701962557954E+03 0.460967618024691E+02 be the output so I can do further proces

Re: [PHP] Regular Expression Backreference in subpattern.

2008-09-27 Thread Shiplu
On 9/27/08, Richard Lynch <[EMAIL PROTECTED]> wrote: > Not sure what you think the (?P is doing, but it looks very suspicious to > me... > > I'm no PCRE expert though... > > Try this: > > '|\\s*charge\\s*\\s*\\s*([0-9]*)\\s*|' > > \\s allows for whitespace > > If you only want ones that HAVE

RE: [PHP] Regular Expression Backreference in subpattern.

2008-09-27 Thread Richard Lynch
e 0-9] bit into + From: Shiplu [EMAIL PROTECTED] Sent: Saturday, September 27, 2008 10:24 AM To: PHP General Subject: [PHP] Regular Expression Backreference in subpattern. The string is "charge100". I want and array( "charge"=>100). I am using t

[PHP] Regular Expression Backreference in subpattern.

2008-09-27 Thread Shiplu
The string is "charge100". I want and array( "charge"=>100). I am using this regular expression, '/([^<]+)<\/td>(?P<\1>\d+)<\/td>/'. But its not working.. I get this error., PHP Warning: preg_match(): Compilation failed: syntax error after (?P at offset 25 in E:\src\php\WebEngine\- on line 4 a

Re: [PHP] Regular Expression differences between 4.4 and 5.2

2008-09-12 Thread Jochem Maas
Ewen Cumming schreef: Actually bummer - testing on wrong version. The U modifier is causing problems too - only matching the first character instead of the whole string. hmm, missed that, that might require adding ?U to relevant sub-assertion ... I'm wondering if your regexp is not 'wrong' (b

Re: [PHP] Regular Expression differences between 4.4 and 5.2

2008-09-12 Thread Ewen Cumming
Actually bummer - testing on wrong version. The U modifier is causing problems too - only matching the first character instead of the whole string. 2008/9/12 Ewen Cumming <[EMAIL PROTECTED]> > Hi Jochem, > > Replacing the 's' modifier with 'm' fixed it this instance but broke other > parts on

Re: [PHP] Regular Expression differences between 4.4 and 5.2

2008-09-12 Thread Ewen Cumming
Hi Jochem, Replacing the 's' modifier with 'm' fixed it this instance but broke other parts on the site (the same result as removing 's'). But the other regex ( $pattern = "/ ]+)([^>]*)>(.*?)| ]+)([^>]*)>/Ui";) is working perfectly. I will continue to test and see if it throws up any other probl

Re: [PHP] Regular Expression differences between 4.4 and 5.2

2008-09-12 Thread Jochem Maas
Jochem Maas schreef: Ewen Cumming schreef: Hi everybody, ... BUT I may have work around for you, try this regexp (replaces s modifer with m modifier): $pattern = "/ ]+)([^>]*)>(.*?)| ]+)([^>]*)>/mi"; the following pattern also seems to do what you want: $pattern = "/ ]+)([^>]*)>(.*

Re: [PHP] Regular Expression differences between 4.4 and 5.2

2008-09-12 Thread Jochem Maas
Ewen Cumming schreef: Hi everybody, ... ]+)([^>]*)>(.*?)| ]+)([^>]*)>/si"; preg_match_all( $pattern, $string, $matches ); echo phpversion(); var_dump($matches); ?> Input.inc contains the string that is giving the different results - its probably to long to include so you can find it at h

[PHP] Regular Expression differences between 4.4 and 5.2

2008-09-12 Thread Ewen Cumming
Hi everybody, I'm trying to migrate our PHP code base to PHP5. For the most part the transition hs been smooth however I'm really stuck on a regular expression which gives different results in 4.4 and 5.2. I've looked through migration guides but as far as I can see nothing should have changed in

Re: [PHP] Regular Expression by Exception

2008-08-04 Thread Micah Gersten
I don't know how to use the POSIX classes, but if you use preg_replace: preg_replace("/[^$params]/", '', $string); I think this will work. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Alberto García Gómez wrote: > Fellows: > > If I use ereg_replace($param

[PHP] Regular Expression by Exception

2008-08-04 Thread Alberto García Gómez
Fellows: If I use ereg_replace($params, $string) I can replace the char that match with $params in the $string. BUT, how I can replace ALL chars EXCEPT the chars in $params. Something like !$params, I think -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://w

Re: [PHP] Regular Expression help need

2008-07-27 Thread James Dempster
On Fri, Jul 25, 2008 at 1:08 PM, Shelley <[EMAIL PROTECTED]> wrote: > Hi Richard, > > Not exactly actually. > > What I mean is: > Before: hi Richard>, & good morning< > After: hi Richard>, & good morning< > > I hope it's clear now. > > On Fri, Jul 25, 2008 at 7:53 PM, Richard Heyes <[EMAIL PROTE

Re: [PHP] Regular Expression help need

2008-07-27 Thread Richard Heyes
> Before: hi Richard>, & good morning< > After: hi Richard>, & good morning< By the sounds of it negative look ahead assertions may be of some help. Or look behind assertions. -- Richard Heyes http://www.phpguru.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: htt

Re: [PHP] Regular Expression help need

2008-07-26 Thread Micah Gersten
Are you talking about looking at blogs in a mobile phone browser or actually downloading the blog into another format? Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Shelley wrote: > Ok, let me tell you what i want to achieve. > I want to transfer users' b

Re: [PHP] Regular Expression help need

2008-07-25 Thread Shelley
Ok, let me tell you what i want to achieve. I want to transfer users' blog onto mobile phone, so I should convert characters such as >, <, & (but not &, or >, or <, etc) into xml compatible ones, >, < &. Maybe there is some problem in my expression? Waiting for your response... On Sat, Jul 26, 2

Re: [PHP] Regular Expression help need

2008-07-25 Thread Micah Gersten
Are you trying to make it xml compatible or XHTML compatible? '&' is not valid HTML or XHTML as it has special meaning. If you want it to adhere to the standard and display correctly, you must use '&' Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Shelley w

Re: [PHP] Regular Expression help need

2008-07-25 Thread Shelley
Hi Richard, Not exactly actually. What I mean is: Before: hi Richard>, & good morning< After: hi Richard>, & good morning< I hope it's clear now. On Fri, Jul 25, 2008 at 7:53 PM, Richard Heyes <[EMAIL PROTECTED]> wrote: > > How can I make a string with & (NOT &, >, < or "), <, > > xml > > co

Re: [PHP] Regular Expression help need

2008-07-25 Thread Richard Heyes
> How can I make a string with & (NOT &, >, < or "), <, > xml > compatible? > What is the expression to use? Not entirely sure what you're after (try posting some before and after snippets), but by the sounds of it you don't need a regular expression - strtr() will work for you. Or str_replace().

[PHP] Regular Expression help need

2008-07-25 Thread Shelley
Hi all, How can I make a string with & (NOT &, >, < or "), <, > xml compatible? What is the expression to use? Thank you very much. -- Regards, Shelley

Re: [PHP] regular expression to find body text in mobile

2008-06-12 Thread Yui Hiroaki
The server recieve email from mobile phone. I would like to retrieve the text of body of mobile phone, which recieve email from mobile phone email. Of cource, server run php and is able to use regular expression. But the email, which is recieved by mobile phone, retrieve text body on server. Reg

Re: [PHP] regular expression to find body text in mobile

2008-06-11 Thread Nitsan Bin-Nun
I'm confused. PHP runs on the server, so it shouldn't be a problem at all to run regex search/reaplce/match/whatever on mobile phone internet, maybe you are talking on JS regex? Nitsan On 11/06/2008, Yui Hiroaki <[EMAIL PROTECTED]> wrote: > > Doese any know how to find text in mobile using Regul

Re: [PHP] regular expression to find body text in mobile

2008-06-11 Thread Bastien Koert
On Wed, Jun 11, 2008 at 9:43 AM, Yui Hiroaki <[EMAIL PROTECTED]> wrote: > Ooops! > It it mobile mobile phone! > > Regards, > Yui > > 2008/6/11 Richard Heyes <[EMAIL PROTECTED]>: > >> Doese any know how to find text in mobile using Regular Expression? > >> I am using php. > > > > Mobile what? > > >

Re: [PHP] regular expression to find body text in mobile

2008-06-11 Thread Yui Hiroaki
Ooops! It it mobile mobile phone! Regards, Yui 2008/6/11 Richard Heyes <[EMAIL PROTECTED]>: >> Doese any know how to find text in mobile using Regular Expression? >> I am using php. > > Mobile what? > > -- > Richard Heyes > >Employ me: > http://www.phpguru.org/cv > > +

Re: [PHP] regular expression to find body text in mobile

2008-06-11 Thread Richard Heyes
Doese any know how to find text in mobile using Regular Expression? I am using php. Mobile what? -- Richard Heyes Employ me: http://www.phpguru.org/cv ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| +

[PHP] regular expression to find body text in mobile

2008-06-11 Thread Yui Hiroaki
Doese any know how to find text in mobile using Regular Expression? I am using php. Regards, Yui -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] regular expression question

2007-09-01 Thread Richard Heyes
But how? The +[a-z]{2,} seems to allow at least two a-z clusters, but it doesn't include a period. /ml Almost correct. The plus belongs to whatever comes before it, not after. So what you're referring to as matching two or more characters but not the period, is this: [a-z]{2,} And this will

Re: [PHP] regular expression question

2007-08-31 Thread Per Jessen
Matthew Lasar wrote: > At 11:32 AM 8/31/2007, Per Jessen wrote: >>Matthew Lasar wrote: >> >> > But I don't understand why the second half of the regular >> > expression works. I'm talking about this part: >> > >> > @([-a-z0-9]+\.)+[a-z]{2,}/"; >> > >> > why is it able to detect repeated sections o

Re: [PHP] regular expression question

2007-08-31 Thread Matthew Lasar
At 11:32 AM 8/31/2007, Per Jessen wrote: Matthew Lasar wrote: > But I don't understand why the second half of the regular expression > works. I'm talking about this part: > > @([-a-z0-9]+\.)+[a-z]{2,}/"; > > why is it able to detect repeated sections of the email address after > "@" that are sep

Re: [PHP] regular expression question

2007-08-31 Thread Per Jessen
Matthew Lasar wrote: > But I don't understand why the second half of the regular expression > works. I'm talking about this part: > > @([-a-z0-9]+\.)+[a-z]{2,}/"; > > why is it able to detect repeated sections of the email address after > "@" that are separated by periods? like "@email.alaska.co

[PHP] regular expression question

2007-08-31 Thread Matthew Lasar
Hello: I've adapted this regular expression script from a book, but I'm not clear why it works. $email = "[EMAIL PROTECTED]"; $pattern = "/[EMAIL PROTECTED]@([-a-z0-9]+\.)+[a-z]{2,}/"; ___ if ( preg_match($pattern,$email) ) { print "yes! " . $email . " matches!"; } else { print "no match"

RE: [PHP] Regular expression - URL validator

2007-08-29 Thread Richard Lynch
nk is created > correct. > > Is there a way to avoid the first situation... so the link is created > correct? > > Thanks again, > Wagner. > > > > -Original Message- > From: Jim Lucas [mailto:[EMAIL PROTECTED] > Sent: segunda-feira, 27 de agosto d

Re: [PHP] Regular expression - URL validator

2007-08-29 Thread Jim Lucas
Wagner Garcia Campagner wrote: Thanks again Jim, That's what i really need. I'm testing this function... If i put a URL like www.example.com, then it works fine and turns it to http://www.example.com But if i put a URL like http://www.example.com, then it also put another header so it turns t

RE: [PHP] Regular expression - URL validator

2007-08-29 Thread Wagner Garcia Campagner
xample.com I also tried with the strstr function, but receive the same response. Thanks in advance, Wagner. -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED] Sent: terça-feira, 28 de agosto de 2007 18:35 To: [EMAIL PROTECTED] Cc: PHP General Subject: Re: [PHP] Regular expres

Re: [PHP] Regular expression - URL validator

2007-08-28 Thread Jim Lucas
Wagner Garcia Campagner wrote: Thanks Jim, Your sugestion worked perfect for me!! I have another question: After i validate this URL i want to put a link with this URL in my page. The problem is that if the URL is like (www.aol.com), when i create the link, this URL is appended with the URL o

Re: [PHP] Regular expression - URL validator

2007-08-28 Thread shiplu
... so the link is created > correct? > > Thanks again, > Wagner. > > > > -Original Message- > From: Jim Lucas [mailto:[EMAIL PROTECTED] > Sent: segunda-feira, 27 de agosto de 2007 17:36 > To: PHP General; [EMAIL PROTECTED] > Subject: Re: [PHP] Regular expre

RE: [PHP] Regular expression - URL validator

2007-08-28 Thread Wagner Garcia Campagner
-feira, 27 de agosto de 2007 17:36 To: PHP General; [EMAIL PROTECTED] Subject: Re: [PHP] Regular expression - URL validator Wagner Garcia Campagner wrote: > Hello, > > I found this regular expression on a web site. > It is basicaly an URL validator. > > I'm trying to i

Re: [PHP] Regular expression - URL validator

2007-08-27 Thread Jim Lucas
Wagner Garcia Campagner wrote: > Hello, > > I found this regular expression on a web site. > It is basicaly an URL validator. > > I'm trying to implement this in my web site, but i receive errors. > > I think this is a PERL REGEX so what should i do to make it work in php? > > > $valid = > (preg_m

[PHP] Regular expression - URL validator

2007-08-27 Thread Wagner Garcia Campagner
Hello, I found this regular expression on a web site. It is basicaly an URL validator. I'm trying to implement this in my web site, but i receive errors. I think this is a PERL REGEX so what should i do to make it work in php? $valid = (preg_match('^H|h)(T|t)|(F|f))(T|t)(P|p)((S|s)?))\://)

RE: [PHP] Regular Expression just one step away from what I need....

2007-08-17 Thread Jay Blanchard
[snip] I am no regex expert but wouldn't preg_match_all( "/'([^']+)'/Ui", $theString, $matches); Be more flexible? [/snip] Thanks all, I completely forgot about greedy/ungreedy. That is what you get for being rusty! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://

Re: [PHP] Regular Expression just one step away from what I need....

2007-08-17 Thread Geoff Nicol
I am no regex expert but wouldn't preg_match_all( "/'([^']+)'/Ui", $theString, $matches); Be more flexible? On 8/17/07, Thijs Lensselink <[EMAIL PROTECTED]> wrote: > > > If it's only real words this will do: > > $theString = "'foo''bar''glorp'"; > preg_match_all( "/'([a-z]+)'/Ui", $theString, $ma

Re: [PHP] Regular Expression just one step away from what I need....

2007-08-17 Thread Robert Cummings
On Fri, 2007-08-17 at 12:00 -0500, Jay Blanchard wrote: > Given the string 'foo''bar''glorp' (all quotes are single quotes)I had > hoped to find a regular expression using preg_match that would return an > array containing just those words without having to go through > additional gyrations, like e

Re: [PHP] Regular Expression just one step away from what I need....

2007-08-17 Thread Thijs Lensselink
Jay Blanchard wrote: > Given the string 'foo''bar''glorp' (all quotes are single quotes)I had > hoped to find a regular expression using preg_match that would return an > array containing just those words without having to go through > additional gyrations, like exploding a string to get an array.

[PHP] Regular Expression just one step away from what I need....

2007-08-17 Thread Jay Blanchard
Given the string 'foo''bar''glorp' (all quotes are single quotes)I had hoped to find a regular expression using preg_match that would return an array containing just those words without having to go through additional gyrations, like exploding a string to get an array. I have only had limited luck

Re: [PHP] regular expression and forbidden words

2007-07-18 Thread Ben Schmidt
Nicolas Quirin wrote: Hi, i'm french, i'm using regular expressions in php in order to rewrite hyperlink tags in a specific way before apache output is beeing sent to client. Purpose is to replace href attribute of any A html tag by a javascript function calling an ajax loader. Currently

Re: [PHP] regular expression and forbidden words

2007-07-18 Thread Ben Schmidt
Nicolas Quirin wrote: Hi, i'm french, i'm using regular expressions in php in order to rewrite hyperlink tags in a specific way before apache output is beeing sent to client. Purpose is to replace href attribute of any A html tag by a javascript function calling an ajax loader. Currently

[PHP] regular expression and forbidden words

2007-07-18 Thread Nicolas Quirin
Hi, i'm french, i'm using regular expressions in php in order to rewrite hyperlink tags in a specific way before apache output is beeing sent to client. Purpose is to replace href attribute of any A html tag by a javascript function calling an ajax loader. Currently I have wrote that: $p

[PHP] regular expression and forbidden words

2007-07-17 Thread Nicolas Quirin
Hi, i'm french, i'm using regular expressions in php in order to rewrite hyperlink tags in a specific way before apache output is beeing sent to client. Purpose is to replace href attribute of any A html tag by a javascript function calling an ajax loader. Currently I have wrote that: $patt

Re: [PHP] regular expression and forbidden words

2007-07-17 Thread Arpad Ray
Nicolas Quirin wrote: Hi, i'm french, i'm using regular expressions in php in order to rewrite hyperlink tags in a specific way before apache output is beeing sent to client. Purpose is to replace href attribute of any A html tag by a javascript function calling an ajax loader. Currently I h

[PHP] regular expression and forbidden words

2007-07-17 Thread Nicolas Quirin
Hi, i'm french, i'm using regular expressions in php in order to rewrite hyperlink tags in a specific way before apache output is beeing sent to client. Purpose is to replace href attribute of any A html tag by a javascript function calling an ajax loader. Currently I have wrote that: $patt

Re: [PHP] Regular Expression

2007-02-05 Thread Frank Arensmeier
5 feb 2007 kl. 22.12 skrev H.T: Do you know good regular expression editor or something simialar? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Regex online: www.regextester.com //frank -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Regular Expression

2007-02-05 Thread Richard Lynch
On Mon, February 5, 2007 3:12 pm, H.T wrote: > Do you know good regular expression editor or something simialar? "The Regex Coach" Helps you figure things out piece by piece with fancy color highlighting of what matches what, and a tree graph and everything. -- Some people have a "gift" link he

Fw: [PHP] Regular Expression

2007-02-05 Thread Satyam
- Original Message - From: "H.T" <[EMAIL PROTECTED]> To: Sent: Monday, February 05, 2007 10:12 PM Subject: [PHP] Regular Expression Do you know good regular expression editor or something simialar? This goes into the 'something similar' category: Fro

[PHP] Regular Expression

2007-02-05 Thread H.T
Do you know good regular expression editor or something simialar? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regular Expression Problem

2007-01-24 Thread Jochem Maas
Roman Neuhauser wrote: > # [EMAIL PROTECTED] / 2007-01-24 23:55:27 +0100: >> Roman Neuhauser wrote: >>> Are you doing this to learn regular expressions or are you actually >>> trying to do work? Because you're going the wrong way. >>> It's XML, why do you treat it as text? >> not everyone shares th

Re: [PHP] Regular Expression Problem

2007-01-24 Thread Jochem Maas
Richard Luckhurst wrote: > Hi Jochem, > > JM> > JM> you be needing an ungreedy modifier on yer regex. > JM> > > JM> see here: > JM> http://php.net/manual/en/reference.pcre.pattern.modifiers.php > > Thanks very much. That solved my problem and I my now getting exactly what I > want. I h

Re: [PHP] Regular Expression Problem

2007-01-24 Thread Richard Lynch
You want to add a 'U' after you closing # so that matches are "Ungreedy" -- I.e., they do NOT grab as much text as the can to fulfill the pattern (greedy) but they grab as LITTLE text as they can to fulfill the pattern (ungreedy) On Wed, January 24, 2007 4:27 pm, Richard Luckhurst wrote: > Hi List

Re: [PHP] Regular Expression Problem

2007-01-24 Thread Paul Novitski
At 1/24/2007 02:27 PM, Richard Luckhurst wrote: What I am trying to do is extract the first chunk. ... preg_match('##', $xml_string,$matches); $tempstr = $matches[0]; What I actually get in $tempstr is everything from the first through to the last (second) I would have expected preg_match

Re[2]: [PHP] Regular Expression Problem

2007-01-24 Thread Richard Luckhurst
Hi Jochem, JM> JM> you be needing an ungreedy modifier on yer regex. JM> JM> see here: JM> http://php.net/manual/en/reference.pcre.pattern.modifiers.php RL Thanks very much. That solved my problem and I my now getting exactly what I RL want. I had seen the reference to greedy and ungre

Re: [PHP] Regular Expression Problem

2007-01-24 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-25 09:27:59 +1100: > > addInfPrice="0.0"> > > > > > > addInfPrice="0.0"> > > >

Re: [PHP] Regular Expression Problem

2007-01-24 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-24 23:55:27 +0100: > Roman Neuhauser wrote: > > Are you doing this to learn regular expressions or are you actually > > trying to do work? Because you're going the wrong way. > > It's XML, why do you treat it as text? > > not everyone shares that sentiment. in terms o

Re: [PHP] Regular Expression Problem

2007-01-24 Thread Jochem Maas
Roman Neuhauser wrote: > # [EMAIL PROTECTED] / 2007-01-25 09:27:59 +1100: >> I must be dumb as I have been battling my way through regular expression >> examples for a while and I can not work out why the following does not work >> properly. I am the first to admit that regular expressions confuse

Re[2]: [PHP] Regular Expression Problem

2007-01-24 Thread Richard Luckhurst
Hi Roman, RN> Are you doing this to learn regular expressions or are you actually RN> trying to do work? Because you're going the wrong way. RN> It's XML, why do you treat it as text? I am well aware it is XML and I could use an XML parser or simpleXML. I am trying to learn regular expressions as

Re: [PHP] Regular Expression Problem

2007-01-24 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-25 09:27:59 +1100: > I must be dumb as I have been battling my way through regular expression > examples for a while and I can not work out why the following does not work > properly. I am the first to admit that regular expressions confuse me greatly. > > The string

[PHP] Regular Expression Problem

2007-01-24 Thread Richard Luckhurst
Hi List I must be dumb as I have been battling my way through regular expression examples for a while and I can not work out why the following does not work properly. I am the first to admit that regular expressions confuse me greatly. The string is a piece of XML as follows and I have put that s

Re: [PHP] regular expression help!

2007-01-18 Thread Roman Neuhauser
(Haven't received William's email yet => scavenging Jochem's reply.) # [EMAIL PROTECTED] / 2007-01-18 18:01:19 +0100: > William Stokes wrote: > > "Roman Neuhauser" <[EMAIL PROTECTED]> kirjoitti > >> This passes with 5.2: > >> > >> class ImgSrcTest extends Tence_TestCase > >> { > >>private $sr

Re: [PHP] regular expression help!

2007-01-18 Thread Jochem Maas
William Stokes wrote: > Hello Roman, > > Could you specify the functionality of your script a bit please. (How it > works) it's a hint as to how you might use simpleXML to extract the values of a src attribute from the definition of an img tag. > > I forgot to mention that this part: > > ', >

Re: [PHP] regular expression help!

2007-01-18 Thread William Stokes
Hello Roman, Could you specify the functionality of your script a bit please. (How it works) I forgot to mention that this part: ', is not always the same. The image properties can vary. Thanks -Will "Roman Neuhauser" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED] ># [EMAIL PR

Re: [PHP] regular expression help!

2007-01-18 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-18 12:34:36 +0200: > I need to strip all characters from the following text string exept the > image path... > > " src=\"../../images/new/thumps/4123141112007590373240.jpg\" />"...and then > store the path to DB. Image path lengh can vary so I guess that I need to

[PHP] regular expression help!

2007-01-18 Thread William Stokes
Hello, Can someone here give me a glue how to do the following. I guess I need to use regular expressions here. I have absolutely zero experience with regular expressions. (if there's another way to do this I don't mind. I jus need to get this done somehow :) I need to strip all characters fro

Re: [PHP] Regular Expression help

2007-01-04 Thread Jochem Maas
Arpad Ray wrote: > Note that $ allows a trailing newline, but \z doesn't. I had to test that before believing you: php -r 'var_dump(preg_match("#^[a-z]+\$#","abc"),preg_match("#^[a-z]+\$#","abc\n"),preg_match("#^[a-z]+\z#","abc\n"));' you are right, that could consitute a nice big gotcha in som

Re: [PHP] Regular Expression help

2007-01-04 Thread Arpad Ray
Note that $ allows a trailing newline, but \z doesn't. Arpad Stut wrote: Chris Boget wrote: echo 'Is String: [' . ( is_string( 'a1b2c3' ) && preg_match( '/[A-Za-z]+/', 'a1b2c3' )) . ']'; echo 'Is Numeric: [' . ( is_numeric( 'a1b2c3' ) && preg_match( '/[0-9]+/', 'a1b2c3' )) . ']'; echo 'Is St

Re: [PHP] Regular Expression help

2007-01-04 Thread Stut
Chris Boget wrote: echo 'Is String: [' . ( is_string( 'a1b2c3' ) && preg_match( '/[A-Za-z]+/', 'a1b2c3' )) . ']'; echo 'Is Numeric: [' . ( is_numeric( 'a1b2c3' ) && preg_match( '/[0-9]+/', 'a1b2c3' )) . ']'; echo 'Is String: [' . ( is_string( 'abcdef' ) && preg_match( '/[A-Za-z]+/', 'abcdef' )

  1   2   3   4   5   >