Skip to content

Tag: extract

Whats wrong with this regex to remove substring?

Trying to strip out the extra addressee from an address string. In the example below, dba bobs is the targeted string to remove. The above yields: When the desired is: What am I doing wrong? Sometimes the input has a ‘n’ before the ‘dba’. Answer You can simplify your regex to: /b(attn|…