wow! i conceed.. you are right..doing a bit of testing, i've realized that i 
have assumed something about the ? that is not quite right.

using "the quick brown fox jumped over the lazy bear"
...*b   will match "the quick brown fox jumped over the lazy "
...*?b  will match "the quick "

my mistake here was in the interpretaton of the ? (normally meaning optional) 
and i'm guessing that when used next to a * or + (and you did just say this) it 
means "lazy match"

i'm glad this came up cause that actually answers my question about how to 
solve the matching between tags.

man i feel like a schmuck now. ;)
-Chris



>chris porter wrote:
>> i wouldnt say confused.. i think the correct term should be "less
>> greedy".. but in the eyes of someone learning.. its easier to
>> describe '.*' (very greedy)  as all consuming and uses lots of
>> backtracking.. and [^x]* as stoping at X (minimal backtracking and
>> fewer captured characters)
>
>I completely disagree.  There is a technical definition of greediness. 
>See below, or "Mastering Regular Expressions" from O'Reilly, or the Perl 
>documentation, etc.
>
>
>That actually isn't what "greedy" means.  Greediness means that the 
>sub-expression will match the most characters possible while still 
>allowing the expression as a whole to match.  Non-greedy or lazy 
>matching matches the fewest characters that will allow the expression as 
>a whole to match.  Generally, the terms greedy and non-greedy or lazy 
>are only applied to the * and + operators, though I've seen it in 
>reference to the {n,m} and {n} constructs on occasion.
>
>--Ben

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase Studio MX with Flash Pro from House of Fusion, a Macromedia Authorized 
Affiliate and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=51

Message: http://www.houseoffusion.com/lists.cfm/link=i:21:861
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to