I am reading The Java™ Tutorials, Regular Expressions, Boundary Matchers.
How can I find dog
when it is after the end of the previous match, but not when it is at the start of the string.
For example:
\Gdog
will find 2 matches in dogdog
but I don't want to catch the first dog
because it is not after the previous match (there is no previous match).
Why does \Gdog
match the first dog
when we don't have previous match?
One more question: There is special symbol for start of input: \A
. How can I negate its meaning, i.e. "not at the start of the input". I tried with
\a
, but that did not work. And, what's the meaning of \a
?
Thanks in advance.