Start a new topic

Regex to find "if field does not contain...."

Hi hive mind!

We are using an import file, which unhelpfully has all the main four options of contact preference (post, telephone, text, email) concatenated together looking like this:

I am happy to be contacted via post | I am happy to be contacted via email | I am happy to be contacted via text | I am happy to be contacted via telephone

I have managed to regex a dictionary using:


to apply "Yes to telephone" in the constituent attributes, however I now need the opposite, so I need "if field does not contain telephone" so I can add "No to telephone".

Can anyone help please?

Many thanks


Hi Gemma

Since the first line is converting anything that contains telephone to the string "Yes to telephone" then the next line will need to search for anything that doesn't contain that.  So your value to match on would be  ^(?!Yes to telephone).*$ 



Many thanks for your help John!

Login or Signup to post a comment