Re: [PHP] extract escaped quoted strings

2008-04-01 Thread Richard Lynch
Extract them from what? Without more context, we can't really help... So far a GREEDY pcre with quote on each end fits all the inputs. And *WHY* do you have so many backslashes? Whatever is causing that (MagicQuotes, cough, cough) is your REAL problem. Fix the problem, not the symptom. On Sat

Re: [PHP] extract escaped quoted strings

2008-03-29 Thread Adam Jacob Muller
token_get_all, fantastic! Thanks. - Adam On Mar 29, 2008, at 10:02 PM, Robert Cummings wrote: On Sat, 2008-03-29 at 21:31 -0400, Adam Jacob Muller wrote: Yes, php source code. You will not be able to do this with PCRE. You need something that can track state because double quotes can appear

Re: [PHP] extract escaped quoted strings

2008-03-29 Thread Robert Cummings
On Sat, 2008-03-29 at 21:31 -0400, Adam Jacob Muller wrote: > Yes, php source code. You will not be able to do this with PCRE. You need something that can track state because double quotes can appear within HTML outside of PHP blocks, within HEREDOC, within double-quoted strings when backslashed,

Re: [PHP] extract escaped quoted strings

2008-03-29 Thread Casey
On Mar 29, 2008, at 4:16 PM, Adam Jacob Muller <[EMAIL PROTECTED]> wrote: Hi, Have a potentially interesting question here, wondering if anyone has done this one before and could shed some light for me. I have a bit of PHP code that needs to extract some quoted strings, so, very simply: "

Re: [PHP] extract escaped quoted strings

2008-03-29 Thread Adam Jacob Muller
Yes, php source code. On Mar 29, 2008, at 8:54 PM, Robert Cummings wrote: On Sat, 2008-03-29 at 20:41 -0400, Adam Jacob Muller wrote: Assume that you should accept any string that PHP itself would accept, though no processing of the actual escapes is required nor desirable. Sorry, I wasn

Re: [PHP] extract escaped quoted strings

2008-03-29 Thread Robert Cummings
On Sat, 2008-03-29 at 20:41 -0400, Adam Jacob Muller wrote: > Assume that you should accept any string that PHP itself would accept, > though no processing of the actual escapes is required nor desirable. Sorry, I wasn't clear enough :) By source I meant more along the lines of what the text mi

Re: [PHP] extract escaped quoted strings

2008-03-29 Thread Adam Jacob Muller
Assume that you should accept any string that PHP itself would accept, though no processing of the actual escapes is required nor desirable. On Mar 29, 2008, at 8:34 PM, Robert Cummings wrote: On Sat, 2008-03-29 at 19:16 -0400, Adam Jacob Muller wrote: Hi, Have a potentially interesting qu

Re: [PHP] extract escaped quoted strings

2008-03-29 Thread Robert Cummings
On Sat, 2008-03-29 at 19:16 -0400, Adam Jacob Muller wrote: > Hi, > Have a potentially interesting question here, wondering if anyone has > done this one before and could shed some light for me. > I have a bit of PHP code that needs to extract some quoted strings, > so, very simply: > "hello"

[PHP] extract escaped quoted strings

2008-03-29 Thread Adam Jacob Muller
Hi, Have a potentially interesting question here, wondering if anyone has done this one before and could shed some light for me. I have a bit of PHP code that needs to extract some quoted strings, so, very simply: "hello" perfectly fine and works great but, it should also be able to extract "