Catch all content you do not want via Regex

-3

I need to pull a string, by Regex, all content that is not equal to the CNPJ.

Ex:

Line 1 - > 123 - EMPRESA CICLANO101 30.589.587/0001-87

Line 2 - > 4567 - FULANO LTDA28.819.917/0001-31

Line 3 - > 90 - ComPANHIA DEDE 77.282.198/0001-78

The CNPJs are always at the end of the string, and the above examples happen. I'm using Pentaho's "Replace in String."

    
asked by anonymous 28.12.2018 / 23:24

1 answer

0

You can use the following "query" regex, I did a test here and it worked fine with your sample data:

.*(([A-Z])\w+)

+ : takes one or more repetitions;

[A-Z] : characters from A to Z;

. : represents any character, in case its spaces;

* : zero or one reps;

\w : any alpha-numeric character.

I ran the test on this link: link

    
29.12.2018 / 01:08