paul_73820
Nov 07, 2012Nimbostratus
regex for a number between 1-99
Hi There,
I am trying to validate a string with that is like this:
pw-10:1000.100
The regex i am using is:
^pw-[1-9]\d?
This works in perl, and infact in tcl 8.5 but doesnt match in the irule for some reason.
the tcl i am using to see if it work is:
set string "12 Again and again and again ..."
if { [regexp {(^[1-9]\d?)} $string => digits] } {
puts "we got $digits in string"
} else {
puts "nothing here"
}
The irule is like this:
switch -regex $string {
"^pw-[1-9]\d?:" {
do some stuff
}
default {
}
There is more of course but you get the idea.
Any ideas?
Paul