Here is a piece of code that works as I expect it to:
"\\bwork(s?|(?:ing)?)\\s?(?:from)?\\s?home\\b"
it makes the space optional after tele. However, when I try to edit it such that it also includes hyphen(-) by using
"\\bwork(s?|(?:ing)?)([\\s-])?(?:from)?([\\s-])?home\\b"
it stops picking up the matches with spaces too. An example where the first works, but the second does not is This is work from home, on-call position.
What am I doing wrong here? I have a feeling it is something very basic, but I am new to regular expressions and any help would be appreciated.