I am capturing a string that is being passed in a text message. The condition is based on the word "contact".
Here are three sample texts:
ntpd process is not running on lnx31 contact: app-support. @monitoringautomation
ntpd process is not running on lnx31 contact: app-support, @monitoringautomation
ntpd process is not running on lnx31 contact app-support @monitoringautomation
My current regex is:
/(?i)contact:* (\S+),|(?i)contact:* (\S+)\.|(?i)contact:* (\S+)\s*/gm
My question, is there another way to clean this expression up or to shorten it? I have tried the following example, but it does not capture the app team when a period or comma is used, it includes it in the match.
/((?i)contact:* (\S+)(,|\.|\s*))/gm