Skip to main content
Solved

How to filter this words?

  • September 23, 2022
  • 3 replies
  • 16 views

mr_fme
Enthusiast
Forum|alt.badge.img+9

I have one column with this values.

 

I would like to filter only words that contais ABC letters.

 

But can´t be JACABC or RDABC. Sometimes the ABC is stay in second or third word after the comma, like image below:

 

CAP 

Thank´s

Best answer by ebygomm

A string searcher with the following Regex should pass any features where ABC is the start of a string of characters at any point in the string, i.e. will match ABC123 but not JACABC123

\bABC\w+

\b is the word boundary

ABC are the characters ABC

\w+ is any number of word characters following (letter, number, underscore)

 

If you then need the actual matches themselves they are stored in the allmatches list which you can then explode, e.g. the last line in your example would match and return ABC6003 & ABC4

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • September 23, 2022

Use StringReplacer to replace space with nothing AttributeSplitter to split by comma (,), then Tester with Begins with ABC.

I think you need a ListExploder someware.


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • Best Answer
  • September 23, 2022

A string searcher with the following Regex should pass any features where ABC is the start of a string of characters at any point in the string, i.e. will match ABC123 but not JACABC123

\bABC\w+

\b is the word boundary

ABC are the characters ABC

\w+ is any number of word characters following (letter, number, underscore)

 

If you then need the actual matches themselves they are stored in the allmatches list which you can then explode, e.g. the last line in your example would match and return ABC6003 & ABC4


mr_fme
Enthusiast
Forum|alt.badge.img+9
  • Author
  • Enthusiast
  • 145 replies
  • September 23, 2022

A string searcher with the following Regex should pass any features where ABC is the start of a string of characters at any point in the string, i.e. will match ABC123 but not JACABC123

\bABC\w+

\b is the word boundary

ABC are the characters ABC

\w+ is any number of word characters following (letter, number, underscore)

 

If you then need the actual matches themselves they are stored in the allmatches list which you can then explode, e.g. the last line in your example would match and return ABC6003 & ABC4

Thank you very much!