[PHP] Re: regexp novice

2012-05-17 Thread Jim Giner
OOPS FORGOT to mention that I modify the string to add a colon if it is entered without one, so my regexp always expects a ":" to be in the middle. So in actuality - my regexp is 'passing' a value of 13:00 as legitimate, when it should not be. -- PHP General Mailing List (http://www.php.net/

Re: [PHP] Re: regexp questions

2010-05-11 Thread shiplu
oops! Please see the change log for version 8.00 on http://www.pcre.org/changelog.txt Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

Re: [PHP] Re: regexp questions

2010-05-11 Thread Ashley Sheridan
On Tue, 2010-05-11 at 23:29 +0700, shiplu wrote: > I think the error is related to changed described here. > http://www.pcre.org/changelog.txt > > Shiplu Mokadd.im > My talks, http://talk.cmyweb.net > Follow me, http://twitter.com/shiplu > SUST Programmers, http://groups.google.com/group/p2psust

Re: [PHP] Re: regexp questions

2010-05-11 Thread shiplu
I think the error is related to changed described here. http://www.pcre.org/changelog.txt Shiplu Mokadd.im My talks, http://talk.cmyweb.net Follow me, http://twitter.com/shiplu SUST Programmers, http://groups.google.com/group/p2psust Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

[PHP] Re: regexp questions

2010-05-11 Thread Al
Get a copy of http://www.weitz.de/regex-coach/ and contribute. Use the pattern on your string, one section at a time. On 5/10/2010 7:53 PM, Spud. Ivan. wrote: Hi, I've recently changed from php 5.1 to 5.3.2 and I'm havong problems with preg_match, because the same regular expressions used i

[PHP] Re: RegExp for preg_split()

2006-04-28 Thread Rafael
Try this (don't pay attention to the name): /** * @param string $text * @returnarray * @since Sat Apr 29 01:35:37 CDT 2006 * @authorrsalazar */ function parse_phrases( $text ) { $arr_pzas = array(); if ( preg_match_all('/(?(?=["\'])(["\']).+?

Re: [PHP] Re: regexp appears to be faulty!?

2004-02-24 Thread Adam Bregenzer
On Tue, 2004-02-24 at 10:49, Henry Grech-Cini wrote: > http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html > > Do we all agree or should I keep trying? The important thing to keep in mind here is to use the right tool for the job. If you are parsing an HTML document lo

[PHP] Re: regexp appears to be faulty!?

2004-02-24 Thread Sven
Henry Grech-Cini schrieb: I came accross this link http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html "> http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html Do we all agree or should I keep trying? Henry hi henry, this could be an interest

[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Sven
Henry Grech-Cini schrieb: Thanks Sven, You are quite right with your "some probs" comment. hi, think i found it. try this: (.*)<\/fieldset>/iU'; ?> the '/U' stands for 'ungreedy'. also note the change in the attribs-regex. hth SVEN -- PHP General Mailing List (http://www.php.net/) To unsubscr

[PHP] Re: regexp appears to be faulty!?

2004-02-24 Thread Henry Grech-Cini
I came accross this link http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html "> http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html Do we all agree or should I keep trying? Henry -- PHP General Mailing List (http://www.php.net/) To unsubsc

[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Henry Grech-Cini
Thanks Sven, You are quite right with your "some probs" comment. Do you know what the the switch is that catches only the least result? I now get (0)= (0)=[hello legendcontent of helloblahgoodbye] (1)= (0)=[ attribute="hello"] (2)= (0)=[hello legendcontent of helloblahgoodbye] as we can see

[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Sven
Henry Grech-Cini schrieb: ... $regexp="/]*)>[^(<\/fieldset>)]*/i"; ... $result=extractFieldsets('testcontent of helloblahgoodbye'); ... And it produced; (0)= (0)=[con] (1)=[goo] (1)= (0)=[ attribute="hello"] (1)=[ attribute="goodbye"] hi, as it is defined in regex-spec: a '^' inside a char-group

[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Henry Grech-Cini
Hi All, I don't actually think regexp is fault. But if anyone could explain this or give me some example code that will extract the attributes and data between a "fieldset" tag pair I would be appreciated. Henry "Henry Grech-Cini" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi

Re: [PHP] Re: regexp: 'a correctly parenthesized substring advanced'

2003-09-30 Thread Jaaboo
hi marek, thanx for your suggestion. i have tried out the tokenizer but 1. i think its not realy final and can change in the future 2. the tokenizer can only find real php code but i need to find my simplified php code without an ; on the end of an statement for example. so the tokenizer doesn't

Re: [PHP] Re: regexp: 'a correctly parenthesized substring advanced'

2003-09-30 Thread Marek Kilimajer
Forget regexp and try this function: http://sk.php.net/manual/en/function.token-get-all.php Jaaboo wrote: I give an wrong example. Here is a better one $txt = "func1($par1," 100 (euro)", func2($par2,"(c) by nobody"))"; if (preg_match_all(' / ([a-zA-Z]\w*?) \s* ( \( ( (?>.*?)| .*?(?R)*

[PHP] Re: regexp: 'a correctly parenthesized substring advanced'

2003-09-30 Thread Jaaboo
I give an wrong example. Here is a better one .*?)| .*?(?R)* ) \) )+ /x ', $txt, $m)){ print_r($m); } else { echo "no match"; } echo "\n"; ?> This must result in : First call: func1($par1," 100 (euro)", func2($par2,"(c) by nobody")) Second call with the inner part $par1," 100 (euro

[PHP] Re: [RegExp] extracting anchors

2003-03-13 Thread Jens Lehmann
Jome wrote: Jens Lehmann wrote: Hello, I want to extract the "name"-attribute of all anchors out of an HTML-source-code which don't have the "href"-attribute. I can use this code to get the "name"-attribute: preg_match_all('/]*?)name=[ \'\"](.*?)[ \'\"](.*?)>/is',$src,$ar); The name-attributes ar

[PHP] Re: [RegExp] extracting anchors

2003-03-12 Thread Jome
Jens Lehmann wrote: > Hello, > > I want to extract the "name"-attribute of all anchors out of an > HTML-source-code which don't have the "href"-attribute. I can use this > code to get the "name"-attribute: > > preg_match_all('/]*?)name=[ \'\"](.*?)[ > \'\"](.*?)>/is',$src,$ar); > > The name-attribu

[PHP] Re: regexp for ' replacement

2002-04-05 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Thalis A. Kalfigopoulos) wrote: > If I have as part of a text: > ...and then 'the quick brown fox jumped over the lazy dog's piano'... > > How can I substitute the single quote in "dog's" with say \' > I want to aply a substitution for only th

[PHP] Re: regexp to substitute incremental strings

2002-01-25 Thread liljim
Hi mweb, try this: blah blah blah some text, html markup... blah blah again"; $string = preg_replace("//i", "", $string); echo nl2br($string); ?> ~James "Mweb" <> wrote in message ... Hello, What is the right regexp to handle this, either in a while loop (how?) or all by itself? The clo

[PHP] Re: regexp (?:

2001-09-11 Thread CC Zona
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Andrew Perevodchik) wrote: > ereg ("aaa(?:bbb|ccc)aaa", $string); > > It causes an error. However "?:" command is > documented in a manual of my version of PHP4. AFAIK, that is only documented in the preg_* chapter, and only applies to the pr

[PHP] Re: regexp (?:

2001-09-11 Thread _lallous
The ereg() is not is not a a Perl Compatible regexp element! try using preg_match() instead! "Andrew Perevodchik" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Why doesn't this simple example work? > > ereg ("aaa(?:bbb|ccc)aaa", $string); > > It causes an err

[PHP] Re: regexp (?:

2001-09-11 Thread Franklin van Velthuizen
"Andrew Perevodchik" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Why doesn't this simple example work? > > ereg ("aaa(?:bbb|ccc)aaa", $string); > > It causes an error. However "?:" command is > documented in a manual of my version of PHP4. It would probably

RE: [PHP] Re: REGEXP

2001-07-17 Thread Adrian D'Costa
> > > > This is wrong. It should be > > Content-Type: multipart/mixed; > > boundary="B42DA66C4EC07C9B572A58FC" > > > > I don't know why it is not reading the whole string. It seems to treat > > the *boundary* part as another line. > > It _is_ another line; it just happens to s

RE: [PHP] Re: REGEXP

2001-07-16 Thread Don Read
On 16-Jul-01 Adrian D'Costa wrote: > Hi James, > > Thanks for your mail. But I think the problem like somewhere else. > > I have the following: > echo $buffer; > There result : > Content-Type: multipart/mixed; > > This is wrong. It should be > Content-Type: multipart/mixed; > boundary="--

[PHP] Re: REGEXP

2001-07-15 Thread Adrian D'Costa
Hi James, Thanks for your mail. But I think the problem like somewhere else. I have the following: echo $buffer; There result : Content-Type: multipart/mixed; This is wrong. It should be Content-Type: multipart/mixed; boundary="B42DA66C4EC07C9B572A58FC" I don't know why it is

[PHP] Re: REGEXP

2001-07-14 Thread James Tan
hi,, u could try using explode function eg: arrayresult = explode(string, separator); cont = explode(thestring, "\""); echo cont[0] ; // result as Content-Type: multipart/mixed; boundary= echo cont[1]; //result as B42DA66C4EC07C9B572A58FC echo cont[2]; // array index 2 will be not