What is the best way to get numbers from strings?

0
Hi all   I have a single address sentence with housenumber in it, i want to capture just the number(s) in it. What is the best way to do this?   Example: Streetname 14 City   What I thought was: a) replace all leters with '' and trim it after it, and parse it to integer? Should I do this by using a regex [A-Za-z] for it? b) find just the numbers consisting from 1,2 or 3 non alphatic characters 0-9?
asked
1 answers
0

Hi Enzo, you can use the RegexReplaceAll java action from the community commons module. This java action performs a regular expression. If you use the regular expression '[^0-9]+' then all numbers are extracted from the string.

answered