RosettaCodeData/Task/Regular-expressions/Tcl/regular-expressions-2.tcl
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

4 lines
144 B
Tcl

set theString "This string has >123< a number in it"
if {[regexp -- {>(\d+)<} $theString -> number]} {
puts "Contains the number $number"
}