I'm looking at a regular expression in our source code, and I'm unsure if it's correct.
<<SWE.[^<<]*>>
Specifically, what does the [^<<]
part do? I thought the brackets allowed you to supply a range. Does it exclude "<<" or just a single "<" ?
If this was a line of text being parsed:
<<SWE.SomeText>><<SWE.SomeMoreText>>
I think the author's intent is to have two matches instead of one.
match[0] = <<SWE.SomeText>>
and
match[1] = <<SWE.SomeMoreText>>
instead of
match[0] = <<SWE.SomeText>><<SWE.SomeMoreText>>
Is there a better way? What about <<SWE.*?>>