I'm looking at someone else's regex... I can make out I'm dealing with a positive lookbehind, but I'm not sure what it's supposed to match: (?<=[^])\t{2,}|(?<=[>])
.
I know [stuff]
matches any character among s, t, u, and f. And I know [^stuff]
matches any character not among those.
But what does [^]
mean? I guess it could mean "anything not of length zero", i.e. "anything". But why wouldn't one just use some expansion on the simple .
expression (to also capture newlines)?
Update:
Per Wikter's comment, [^]
alone isn't valid. But that still leaves me wondering what this thing is supposed to do...
To me, an intuitive reading is...
(?<=[^])
- look behind for whatever [^]
matches
\t{2,}
- then find two or more tabs
|
- if there's not a match for that...
(?<=[>])
- ...look behind for a >
character.
Where is my interpretation missing the mark?