I have a regex expression:
^([ \t\r]*\S+){2}$
It matches name
and group matches e
, in name
.
I expected to not to match name
, but name name
; such as I wanted \S+
work till it matches. I can make it work just a bit changing it:
^([ \t\r]*\S+)([ \t\r]+\S+)$
but I hoped it would be possible to make it shorter.