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/)
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 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)
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
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)
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 (
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,
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
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)=[
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/)
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
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
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
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
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)*
)
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
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
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
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
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
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
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_*
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
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;
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
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
26 matches
Mail list logo