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

Question

Question

How to remove all non numeric characters regex

asked on August 8, 2023

For example I have a mobile phone entry "555-555-5555" which needs to be changed into "5555555555"

Would also need to account for entries such as "555 5555", where the space is the non-numeric character that needs to be removed. 

Does anyone know the regex for removing all non digit values from a string? Doing this in workflow token pattern matching. 

0 0

Replies

replied on August 8, 2023 Show version history

I use this quite often to clean up strings I have captured in Pattern Matching.

[^\s-\(\)\D]

Basically telling it what to exclude and combining the rest

2 0
replied on August 9, 2023

Regular expressions are always fun and usually a lot of ways to accomplish the same thing.
For this type of match I have always just used a \d

 

 

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

Sign in to reply to this post.