"Epper" <m.epper gmail.com> wrote:
>
>
>Hello to everybody, this is my first post...
>
>First of all sorry for my english, I'm Italian ;)
>
>I'm Trying to match php code, by preg functions of php,
and I've some
>problems.
I'm guessing your problem is with the quotes -- you could
use this to
capture the string with the escaped quote in it:
".+?(?<!\\)"
To capture the entire snippet you could use this regex:
http://tinyurl.com/kxf8l
But that one isn't smart enough to know whether it's
double or single
quotes, that would take a little more tweaking and I'm a
bit in a hurry
-- basically just capture the first double or single quote
into a
backreference then reference it at the close of the quotes
to make sure
you're matching them. In this, nothing is pulled into
backreferences, it's
just a quick regex to show how you could capture it.
Also keep in mind that when plugging regex into php, you're
going to have
to double up on backspaces -- so \\ would become \\\\
-- \r would become
\\r etc.
--
Remember, no matter where you go, there you are. -Buckaroo
Banzai
Online Regex find/repalce utility: http://rereplace.com
Command-based online image editor: http://theprawn.com/imag
iine
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regex googlegroups.com
To unsubscribe from this group, send email to
regex-unsubscribe googlegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---
|