Regex to match word with at least one space on either side
Given these phrases:
Records
Records and Stuff
Stuff and Records
A Records Store
GoodRecords
RecordsFest
How can we use regex to match the word Records along with a space on either side? So I would want to match:
[] represents a space:
Records[] from Records and Stuff
[]Records from Stuff and Records
[]Records[] from A Records Store
No match for Records, GoodRecords, RecordsFest
So far, I have this regex: \b[rR]ecords\b which matches just the word Records without the spaces and it’s quite not what I want.
Read more here: Source link
