One Star

Filtering numeric values and alpha-numeric values in a string

Hello,
I have a MSSQL String column having values like "000123", "ABC123", "00-123", etc.
I want to INSERT into a MySQL table only the Numeric values like "000123" because the target datatype is INT.
The rejected values i.e. the values which are alpha-numeric or having any special characters should be sent to a CSV file.
Can you tell me the component to be used or the process to filter just the String having numeric values ?
1 REPLY
One Star

Re: Filtering numeric values and alpha-numeric values in a string

Try with regex such as 
string.matches("^\\p{Digit}+$"))