[PHP] Re: Getting part of string matched with regular expressions

2008-01-28 Thread Max Antonov
Teck wrote: Hi, I'm trying to find a way to get part of a string where the part is matched with regular expressions. So, for example, if I have a string: a2b3cd5ef6ghi7232jklmn I need to grab "12b3cd5" using regular expressions and store the part in a variable. $var = do_something("",""

Re: [PHP] Re: Match anything between two " that is not a " exceptifitis escaped...

2008-01-17 Thread Max Antonov
Jochem Maas : mathieu leddet schreef: Thanks a lot Max (and Jochem), you solved my issue. PS - you solved the issue but did you learn what a [negative] look behind assertion is? Mathieu, I agree with Jochem. If you periodicaly solve issues, such this - you must know about behind assertions

Re: [PHP] Re: Match anything between two " that is not a " exceptif it is escaped...

2008-01-17 Thread Max Antonov
Jochem Maas writes: attend? don't understand what you mean BUT you have given the OP the answer by changing his regexp to include a [negative] look behind assertion for the backslash. :-) I hope, my regular expression answer the purpose, than need Mathieu (what mean abbreviation OP? can send

[PHP] Re: Match anything between two " that is not a " except if it is escaped...

2008-01-17 Thread Max Antonov
mathieu leddet writes: Hi everyone, I am struggling with regular expression trying to match strings delimited by double quotes, but taking into consideration that \" is not a string ending character. .. // pattern for catching strings between " $pattern = '#"([^"]*)"#'; . $out conta