Imagine you are trying to match a pattern with "stackoverflow".
You want the following:
this is stackoverflow and it rocks [MATCH] stackoverflow is the best [MATCH] i love stackoverflow [MATCH] typostackoverflow rules [NO MATCH] i love stackoverflowtypo [NO MATCH]
I know how to parse stackoverflow if it has spaces on both sites using:
/\s(stackoverflow)\s/
The same if its at the beginning or end of a line:
/^(stackoverflow)\s/ /\s(stackoverflow)$/
But how to specify "space or end of line" and "space or beginning of line" using a regular expression?
regex preg-match
anonymous-one Jul 15 2018-11-21T00: 00Z
source share