mrichman
mrichman

Reputation: 41

Get specific string in sentence that doesn't include a specific word in front using REGEX?

I have a table with the underlying dummy data and would like to get a TRUE only when the text has the word "T-Rex" without the word Big in front.

Ideal result:

T-Rex TRUE Big T-Rex FALSE Monkey, T-Rex TRUE

Thanks in advance!

Upvotes: 1

Views: 35

Answers (1)

Bill Huang
Bill Huang

Reputation: 4648

Sample Sheet Here

The task can be achieved using a multi-step workaround.

  1. Match "T-Rex"
  2. Match "Big T-Rex"
  3. Identify records where 1. is true and 2. is false.

Unfortunately you cannot perform lookaheads and lookbehinds according to the official documentation. The reason is discussed here.

Upvotes: 1

Related Questions