Hello All,
Thanks to @FailedDev I currently have the regex below which is used within a preg_match for a shoutbox. What I am trying to achieve in this question is allowing the regex to be case insensitive and give it the ability to allow the use of space(s) in the 'key word', which in this case is fred.
/(?<=^|\s)(?:\bfred\b|\$[$\w]*fred\b)/x
For background info please see the reference link.
Thank you for any help on this.
Update: Thanks to some helpful information, I have come up with the following regex that does what I need, though I feel it is not the most efficient solution.
~(?:(?<=\s|^)[$\S]*|\b)f+(?:\.+|\s+)?r+(?:\.+|\s+)?e+(?:\.+|\s+)?d+(?:\.+|)?\b~i