Regex for From address works in RegexBuddy, but not MailWasher
Posted: Fri Dec 01, 2023 7:57 am
Neighbor is getting mail that shows as being FROM: h'u'lu and would like to mark such mail for deletion. He tells me that the apostrophes may be repeated (ex.: h''ul'u) and may occur following any of the letters h-u-l-u. But at least one of the four letters will have at least one following apostrophe.
The following regex was created to detect such occurrences (but allow 'hulu' with no apostrophes):
(?i)((h'+u'*l'*u'*)|(h'*u'+l'*u'*)|(h'*u'*l'+u'*)|(h'*u'*l'*u'+))
We have tested this regex using the RegexBuddy utility against the string 'h''uluhulu', and it appears to work OK - it matched the 'h''ulu' but not the following hulu. However, MailWasher does not get a match when an actual incoming email FROM: address of h''u'lu arrives.
Any guidance as to what's going on here?
The following regex was created to detect such occurrences (but allow 'hulu' with no apostrophes):
(?i)((h'+u'*l'*u'*)|(h'*u'+l'*u'*)|(h'*u'*l'+u'*)|(h'*u'*l'*u'+))
We have tested this regex using the RegexBuddy utility against the string 'h''uluhulu', and it appears to work OK - it matched the 'h''ulu' but not the following hulu. However, MailWasher does not get a match when an actual incoming email FROM: address of h''u'lu arrives.
Any guidance as to what's going on here?