I'm trying to match strings between whitespaces, but not have the whitespaces included in the results. For example:
Hi, my name is Tudor.
should match my
, name
and is
. My regex is:
(?<=\s){token}(?=\s)
I'm also curious why using
(?:\s){token}(?:\s)
Still keeps the whitespaces in the matches.
So far regex 1 seems to work fine, but I'm wondering if it's correct for all cases since I'm not a regex expert by any means.