$x =~ /[0-9]/;
$x =~ /[a-z]/i; # so match a..z and A..Z as /i is ignore case
$x =~ /[\n\r]/;
#match 1+ chars in the range 0..9 + - and .
#\. escape the dot so it doesn't mean "any 1 char"
$x=~ /[0-9+-\.]+/
Regex: Ranges
Use [ ] for ranges - match any 1 char inside the range
Labels:
perl regex regular expressions
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment