[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: regex help

From: Your Name <ratesnow@mortgage-rates-now.org>
Date: Thu, 18 Jan 2007 23:00:51 -0600
To: xmlschema-dev@w3.org
Message-Id: <E1H7lrv-0006Ak-3V@server35.integrityserver.net>
Re: regex help

Just a note on the greediness mentioned here...

My understanding is that the greediness of a regular expression is 
only an 
issue when you are capturing the values of sub-patterns within the 
target 
data.  (e.g. in Perl 'ML123' =~ /ML(\d+)/; captures 123 into $1.)  
When only 
doing matching, eventually, if possible, the pattern will be matched 
irrespective of whether greedy or non-greedy matching is used.

Greediness just affects whether the regular expression engine attempts 
to 
grab lots of content for a sub-expression in it's first attempt and 
them 
back track, or attempts to capture the minimal amount in its first 
attempt 
and then forward track (not sure if that's a proper term!).

If anyone's opinion differs, please let me know
Received on Sunday, 21 January 2007 23:43:41 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.