Skip to main content
The+Yala+Studio
Known Participant
January 15, 2019
Question

Find character + except + character?

  • January 15, 2019
  • 3 replies
  • 571 views

Hi all,

Is it possible to find the following:

any character      +    except a letter     +     any character

That means for example: Finding any contiguous characters except characters with (b) letter between them.

Best Regards.

This topic has been closed for replies.

3 replies

Barb Binder
Community Expert
Community Expert
January 18, 2019

Hi Yala:

Is the issue that you didn't select the GREP tab before running the search? No one actually mentioned that you need to.

~Barb

~Barb at Rocky Mountain Training
The+Yala+Studio
Known Participant
January 18, 2019

Thank you very much for your replies.

Unfortunately, I couldn't apply your (phrases).

It seems I need more details.

Thank you at all for your assistance.

pixxxelschubser
Community Expert
Community Expert
January 18, 2019

Hi Yala K. Al-Douri

Please show a few exact text examples (as text) and describe in detail, what the grep should do (at the best with two additional screenshots (before and after)).

Because of: both greps (by grudgemom and [Jongware]) working as expected.

grudgemom
Known Participant
January 15, 2019

Find [\l\u][a|c-z][\l\u]

[\l\u] - any character but only 1 instance of it

[a|c-z] - any character except b (a OR c thru z)

[\l\u] - any character but only 1 instance of it

This won't find anything longer than a 3-character word though.

Jongware
Community Expert
Community Expert
January 16, 2019

It actually will find words of any length, but just match each section of 3 letters long -- so possibly multiple times inside anything longer. (If you only want to match exactly 3-letter words, add a "word break" \b before and after.)

An alternative is to use a negative lookahead, by the way: the bolded part in this

[\u\l](?!b)[\u\l][\u\l]

I think we need to see a concrete sample to suggest any more.