Quote:
Originally Posted by jcky
If you want to match only numbers, you might use:
[[:digit:]]
Could you please help me to give an example on how to use [[:digit:]]?
Thanks
Br.
|
Where did you find this?
This is what is generally called a "regular expression" (AKA regex)---which I think can be defined as a string of characters used to designate classes or types of data as opposed to specific data. Examples:
"." = any character
"*" = any number of the preceding regex
thus:
".*" = any number of characters
regexes are used in a wide variety of utilities--eg SED, AWK, GREP--and in programming languages such as PERL.
[ ] defines a "character class", and [:digit:] is a character type
[[:digit:][:blank:]] = a single number or a white space
Good tutorial here:
http://www.grymoire.com/Unix/