Hello All,
I am trying to widen the scope on a preg_match I currently use in a shoutbox. I am struggling to build on my current regular expression to obtain the desired identification. Please see the current regex I am using followed by some information on the matches I would like to achieve.
Current regular expression:
~\bf+(?:\.+|\s+)?r+(?:\.+|\s+)?e+(?:\.+|\s+)?d+(?:\.+|)?\b~i
Desired match info:
[01] Lorem ipsum dolor fred sit amet.
- Identify key word.
[02] Lorem ipsum dolor $fred sit amet.
- Identify single dollar symbol and key word.
[03] Lorem ipsum dolor $ofred sit amet.
- Identify single dollar symbol followed by a single alphanumeric character and key word.
[04] Lorem ipsum dolor $ooofred sit amet.
- Identify single dollar symbol followed by multiple alphanumeric characters and key word.
[05] Lorem ipsum dolor $$$ooofred sit amet.
- Identify multiple dollar symbols followed by multiple alphanumeric characters and key word.
[06] Lorem ipsum dolor $$$ofred sit amet.
- Identify multiple dollar symbols followed by a single alphanumeric character and key word.
[07] Lorem ipsum dolor $o$oo$$$ofred sit amet.
- Identify any combination of dollar symbols and alphanumeric characters followed by key word.
[08] Lorem ipsum dolor $o$oo $$$ofred sit amet.
- Spaces break the identification
[09] $ofred sit amet.
- Identified with no leading spaces
[10] Lorem ipsum dolor $ofred
- Identified with no trailing spaces
[11] Lorem ipsum dolor $ofred!
- Identified with trailing symbols
Thank you for any help, it's much appreciated.