You are viewing limited content. For full access, please sign in.

Question

Question

Regular Expression with Multiple Characters and _

asked on November 2, 2017

Hi, 

I have to extract the first value from the string before the underscore [_], the string before the _ can contain numbers or just words or both and no set value of how many characters in the string, it always varies. 

 

ABDHS23423_Paid_Up_L etter_2017_09_18_145444

Result should be = ABDHS23423

1ADT122435_Settlement_Letter_2017_09_18_122312

Result should be = 1ADT122435

43074635_Statement_2017_14_15_12312

Result should be = 43074635

 

Regex i have tried which works on testing tools, but not on Workflow. 

 

^([A-z,0-9]+)_.*

0 0

Answer

SELECTED ANSWER
replied on November 2, 2017

Hi Gert,

Try this:

  • ^([^_]+)_.*


It's basically saying "from the start of the input, grab everything that's not an underscore and stop at the first underscore".

~Rob

3 0

Replies

replied on November 2, 2017

Thanks that works!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.