Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

extract numners from string linux

$ NUMBER=$(echo "I am 999 years old." | grep -o -E '[0-9]+')
$ echo $NUMBER
999
Source by linuxconfig.org #
 
PREVIOUS NEXT
Tagged: #extract #numners #string #linux
ADD COMMENT
Topic
Name
1+6 =