Hi,
The regular expression below works on just about everything except nested
parentheses:
Regular Expressions are used to define regular (Type 3 in Chomsky Hirarchy)
grammars. You can not express nested parentheses in regular grammar, you need
a context free (Type 2) but not regular
On Mar 29, 2007, at 4:55 AM, Christof Donat wrote:
Regular Expressions are used to define regular (Type 3 in Chomsky
Hirarchy)
grammars. You can not express nested parentheses in regular
grammar, you need
a context free (Type 2) but not regular grammar.
Christof, that is fascinating!
Christof:
This may be true of traditional regular expressions, which is
something you'll encounter in a college level automata class but very
rarely in the real world. The fact is that most modern, since the 80s
at least, regex implementations (JavaScript, Java, PHP,...) can handle
many
Also, when perl 6 is released it will have support for a much more
powerful system called rules which can handle nested parentheses quite
handily.
-blair
Jake McGraw wrote:
Christof:
This may be true of traditional regular expressions, which is
something you'll encounter in a college level
Subject: Re: [jQuery] Any regular expression gurus here?
For learning how and why regular expressions work and how to use
Regular Expressions with grep, Perl, Java, .NET and PHP:
Mastering Regular Expressions 3rd Ed. by J. Friedl
For learning JavaScript Regex:
JavaScript: The Definitive
-Interface Development
A: ncy1717
E: [EMAIL PROTECTED]
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jake McGraw
Sent: Tuesday, March 27, 2007 8:03 AM
To: jQuery Discussion
Subject: Re: [jQuery] Any regular expression gurus here?
For learning how and why
Nathan Young -X (natyoung - Artizen at Cisco) wrote:
Hey.
Check out regex coach. It's a debugging tool that let's you run your
expression against sample text and see what's happenning. I can't
overstate how much this can help, and I'd recommend it in addition to
any help you get from books
Subject: Re: [jQuery] Any regular expression gurus here?
I just went cross-eyed looking at your regex, so I'm sorry I can't help you
there (I really need to get a regex book to read), but I know at least in
PHP you can create k:v pairs like this:
preg_match('/(?Pfoo.*)/', 'bar', $matches);
echo
:[EMAIL PROTECTED] On
Behalf Of Kenneth
Sent: Monday, March 26, 2007 7:25 PM
To: jQuery Discussion
Subject: Re: [jQuery] Any regular expression gurus here?
I just went cross-eyed looking at your regex, so I'm sorry I can't help you
there (I really need to get a regex book to read), but I
I just went cross-eyed looking at your regex, so I'm sorry I can't help you
there (I really need to get a regex book to read), but I know at least in
PHP you can create k:v pairs like this:
preg_match('/(?Pfoo.*)/', 'bar', $matches);
echo $matches['foo'];
// outputs: bar
I'm not sure if that
To quote Mastering Regular Expressions 3rd Ed. by J. Friedl:
The real problem is that on the majority of systems, you simply can't
match arbitrarily nested constructs with regular expressions.
He goes on to give the syntax for matching a SINGLE set of nested
parenthesis, it's quite convoluted.
Thanks much.
On 3/26/07, Jake McGraw [EMAIL PROTECTED] wrote:
To quote Mastering Regular Expressions 3rd Ed. by J. Friedl:
The real problem is that on the majority of systems, you simply can't
match arbitrarily nested constructs with regular expressions.
He goes on to give the syntax for
12 matches
Mail list logo