All,
Here are some randomly useful links that we're talking about at the meeting
(sorry for the cross-post):
MySQL Fulltext Indexing
http://dev.mysql.com/tech-resources/articles/full-text-revealed.html
http://dev.mysql.com/doc/refman/5.0/en/fulltext-fine-tuning.html
Packaged AMP On Windows/Linu
One nice 'trick' in using regex to match code is to use another
delimiter character bessides '/' since it is so commonly found in the
'needle' pattern. Other 'common' delimiters are % or #.
e.g. instead of
preg_match('/needle/imUs', $haystack);
do this
preg_match('#needle#imUs', $haystack);
Usi
You are violating 2 rules here of how to use regular expressions.
#1 Regular expressions always needs 2 arguments. 1: Pattern to be matched and
2: String in which defined pattern is to be matched.
Here you missed 2nd arguments that is why parser gives ) => / error.
#2 Quote (double or single) i
Is it returning everything between that first div and the last on the
page? If so, it's being 'greedy'. Basically that .+? is matching
everything (including interior 's). You can use the 'Ungreedy'
modifier 'U' (captial u after the final slash) or make your regex between
the divs more specific
On 11/28/06, Anthony Papillion <[EMAIL PROTECTED]> wrote:
Hello Everyone,
I am using the following regex to retrieve text between two tags.
$trans_text = preg_match(/(.+?)/);
Don't you need to surround the pattern in quotes? I always have.
-c
_
Thanks for the help...that worked. But, for some reason, the entire regex
breaks down now. While I don't get an error, it seems to not be working as I
get the entire text. Is my syntaxt wrong?
Thanks,
Anthony
- Original Message -
From: Paul Houle
To: NYPHP Talk
Sent: Tuesday, Novemb
Anthony Papillion wrote:
Hello Everyone,
I am using the following regex to retrieve text between two tags.
$trans_text = preg_match(/(.+?)/);
However, the parser keeps telling me it expects a ) but found /
instead. What am I doing wrong?
It's probably the / in /div. Try
...<\/div>/
Hello Everyone,
I am using the following regex to retrieve text between two tags.
$trans_text = preg_match(/(.+?)/);
However, the parser keeps telling me it expects a ) but found / instead. What
am I doing wrong?
Can anyone please help a regex newbie in his quest? lol
Thanks,
Anthony__