cancel
Showing results for 
Search instead for 
Did you mean: 

Regular Expression to capture value and exclude the hyphen

Joy_Wood
Star Contributor
Star Contributor

Hi,

Trying to capture an account number into a keyword with regular expression in Advance Capture.  Account number always in this format 12345-12345.  Only need digits, not the hyphen.

1 REPLY 1

Hi Joy,

 

You can do it without a regular expression if you'd like - use the 'specific allowed characters' option, and put 0123456789 as the allowed characters.  This will remove everything that isn't a digit, which would include the hyphen.

 

Alternatively, if you'd prefer to use a regular expression instead, you can use this:

 

(\d\d\d\d\d).?(\d\d\d\d\d)

 

and then set the 'applied data format' to be [1][2] meaning you only want the two capture groups, and not the hyphen in the middle.