Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regex weirdness



I'm no regex expert by a long shot, but I believe that this behavior can be influenced by changing the 'greediness' of the match.

There are "Greedy quantifiers", "Reluctant quantifiers", and "Possessive quantifiers" according to the Pattern docs. I think you might be able to avoid the order dependancy by choosing a different type of quantifier.

On Apr 3, 2004, at 1:23 PM, Greg Guerin wrote:

But I believe the order has a direct bearing on your problem.

...
You have to match the LONGER expression first, otherwise the shorter one
will dominate.\

Greg's comments about case and whitespace are important as well, it's so easy to overlook unconventional, yet valid, tag formatting.


Scott
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Regex weirdness (From: Greg Guerin <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.