Extract part of specific text line

I have the following text stored in the varTxt variable and I need to extract the CPF number “01_Proponente_CPF03625419858_Joao Paulo da Silva”, how can I do it?


we can do it with regex:


ensure following:

Also have a look here:


You can use regular expression to extract it as @ppr proposed. But to be able to generate a safe regular expression we will need more examples. For example, does it always start with “CPF” followed by 11 digits? Do you only want the number part or do you want to extract the CPF part too? “03625419858” or “CPF03625419858”?


@ppr, It worked perfectly, thanks for the quick help.

Thank you @ptrobot , the answer above meets what I need.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.