regex get only numbers code example
Example 1: just number regex
// https://regex101.com/r/qyq3PG/1
// or
/^[0-9]*$/
Example 2: get only numbers regex javascript
var numberPattern = /\d+/g;
'something102asdfkj1948948'.match( numberPattern )
Example 3: regex for numbers
Regex regex = new Regex(@"^\d$");
Example 4: regex all not numbers
echo 1a2b3c | sed 's/[^0-9]//g' #Replaces all not numbers
abc