Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Two regular expression questions

Reply
Thread Tools

Two regular expression questions

 
 
Dang Griffith
Guest
Posts: n/a
 
      02-02-2004
1. Is there a more appropriate newsgroup to post questions regarding
regular expressions? I know many languages now support them, but Perl
is generally considered the de facto standard. (Yes?)

2. Are there plans to add syntax to support matched-nesting, for
things such as balanced parenthesis, angle-brackets, and quote marks?
It's my understanding that there currently is not support for this,
which is why you can't parse xhtml-like text with simply a regular
expression. I.e., you need to go to the next level and write a parser
to maintain the state of the nesting.

Thanks,
--dang
 
Reply With Quote
 
 
 
 
Jeff 'japhy' Pinyan
Guest
Posts: n/a
 
      02-02-2004
On Mon, 2 Feb 2004, Dang Griffith wrote:

>1. Is there a more appropriate newsgroup to post questions regarding
>regular expressions? I know many languages now support them, but Perl
>is generally considered the de facto standard. (Yes?)


This is the place to ask questions about Perl's regexes.

>2. Are there plans to add syntax to support matched-nesting, for
>things such as balanced parenthesis, angle-brackets, and quote marks?
>It's my understanding that there currently is not support for this,
>which is why you can't parse xhtml-like text with simply a regular
>expression. I.e., you need to go to the next level and write a parser
>to maintain the state of the nesting.


You can match nested things with Perl's regexes, because Perl's regexes
aren't... well... regular. You can execute arbitary code. You can
dynamically generate the regex as it's being matched.

--
Jeff Pinyan RPI Acacia Brother #734 2003 Rush Chairman
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      02-02-2004
In article <(E-Mail Removed) m>,
Dang Griffith <(E-Mail Removed)> wrote:
:1. Is there a more appropriate newsgroup to post questions regarding
:regular expressions? I know many languages now support them, but Perl
:is generally considered the de facto standard. (Yes?)

What perl supports are not really regular expressions; it supports
a superset of regular expressions that can match things that
regular expressions cannot. Thus, if you are trying to study
true regular expressions, you might be better off looking elsewhere.


:2. Are there plans to add syntax to support matched-nesting, for
:things such as balanced parenthesis, angle-brackets, and quote marks?

It isn't just a matter of syntax: it fundamentally affects the
search strategy. True regular expressions *cannot* do balancing
no matter what syntax you use.

--
Positrons can be described as electrons traveling backwards in time.
Certainly many Usenet arguments about the past become clearer when they
are re-interpreted as uncertainty about the future.
-- Walter Roberson
 
Reply With Quote
 
Dang Griffith
Guest
Posts: n/a
 
      02-03-2004
On Mon, 2 Feb 2004 12:56:41 -0500, Jeff 'japhy' Pinyan
<(E-Mail Removed)> wrote:

>On Mon, 2 Feb 2004, Dang Griffith wrote:
>
>>1. Is there a more appropriate newsgroup to post questions regarding
>>regular expressions? I know many languages now support them, but Perl
>>is generally considered the de facto standard. (Yes?)

>
>This is the place to ask questions about Perl's regexes.
>
>>2. Are there plans to add syntax to support matched-nesting, for
>>things such as balanced parenthesis, angle-brackets, and quote marks?
>>It's my understanding that there currently is not support for this,
>>which is why you can't parse xhtml-like text with simply a regular
>>expression. I.e., you need to go to the next level and write a parser
>>to maintain the state of the nesting.

>
>You can match nested things with Perl's regexes, because Perl's regexes
>aren't... well... regular. You can execute arbitary code. You can
>dynamically generate the regex as it's being matched.

Thanks to Jeff and Walter. You both confirmed what I thought to be
the case. I.e., regular expressions cannot support nested matching,
but that additional programming can be created to support it.
--dang rpi '87
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Seek xpath expression where an attribute name is a regular expression GIMME XML 3 12-29-2008 03:11 PM
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C++ 42 11-04-2008 12:39 PM
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" Adem C Programming 45 11-04-2008 12:39 PM
Matching abitrary expression in a regular expression =?iso-8859-1?B?bW9vcJk=?= Java 8 12-02-2005 12:51 AM
Dynamically changing the regular expression of Regular Expression validator VSK ASP .Net 2 08-24-2003 02:47 PM



Advertisments