August 26th, 2011, 06:01 PM
Can you use the number of matched characters later in the regex?
I'm using Java's regex engine. I've got data that matches:
What it really means is any of:
or two letters and six digits
or one letter and seven digits.
It would be cool if I could have some sort of backreference to the number of characters matched in the pattern so I could use something like
Is this possible?
August 26th, 2011, 06:47 PM
Not really, but if you can have
That's normally more complicated than I go - I typically go the same kind of alternation route you did:
(Basically, I start with the first and unravel as I feel like it.)
Comments on this post