[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/)

[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

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)

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

[PHP] Re: RegExp for preg_split()

2006-04-29 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 (

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

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

2004-02-24 Thread Sven
Henry Grech-Cini schrieb: ... $regexp=/fieldset([^]*)[^(\/fieldset)]*/i; ... $result=extractFieldsets('testfieldset attribute=hellocontent of hello/fieldsetemblah/emfieldset attribute=goodbyegoodbye/fieldset'); ... And it produced; (0)= (0)=[fieldset attribute=hellocon] (1)=[fieldset

[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)=[fieldset attribute=hellolegendhello legend/legendcontent of hello/fieldsetemblah/emfieldset attribute=goodbyegoodbye/fieldset] (1)= (0)=[

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

2004-02-24 Thread Henry Grech-Cini
I came accross this link a href= 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 /a Do we all agree or should I keep trying? Henry -- PHP General Mailing List (http://www.php.net/)

[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: ?php $rx = '/fieldset.*(.*)\/fieldset/iU'; ? the '/U' stands for 'ungreedy'. also note the change in the attribs-regex. hth SVEN -- PHP General Mailing List

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

2004-02-24 Thread Sven
Henry Grech-Cini schrieb: I came accross this link a href= 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 /a Do we all agree or should I keep trying? Henry hi henry, this could be an

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

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

2003-09-30 Thread Jaaboo
I give an wrong example. Here is a better one ?php $txt = func1($par1, 100 (euro), func2($par2,(c) by nobody)); if (preg_match_all(' / ([a-zA-Z]\w*?) \s* ( \( ( (?.*?)| .*?(?R)* ) \) )+ /x ', $txt, $m)){ print_r($m); } else { echo no match; } echo \n; ? This must result in

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 ?php $txt = func1($par1, 100 (euro), func2($par2,(c) by nobody)); if (preg_match_all(' / ([a-zA-Z]\w*?) \s* ( \( ( (?.*?)| .*?(?R)* )

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

[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('/a([^]*?)name=[ \'\](.*?)[ \'\](.*?)/is',$src,$ar); The name-attributes are

[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('/a([^]*?)name=[ \'\](.*?)[ \'\](.*?)/is',$src,$ar); The name-attributes are now in

[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 the single

[PHP] Re: regexp to substitute incremental strings

2002-01-25 Thread liljim
Hi mweb, try this: ? $string = IMG SRC=\C:\dir1\dir2\dir3\img1.gif\ blah blah blah some text, html markup... IMG SRC=\img2.jpg\ blah blah again; $string = preg_replace(/IMG SRC=\.*?([0-9])\.(gif|jpg)\/i, IMG SRC=\UNIQUE_CODE_0$1.$2\, $string); echo nl2br($string); ? ~James Mweb wrote in

[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 be useful if

[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 preg_*

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 starts with

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;

[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