Anonymous user
Regular expressions: Difference between revisions
m
→{{header|Tcl}}: formatting
(→{{header|C}}: + AWK) |
m (→{{header|Tcl}}: formatting) |
||
Line 470:
=={{header|Tcl}}==
Test using <tt>regexp</tt>:
▲ if {[regexp -- {string$} $theString]} {
▲ }
puts "Does not start with 'You'\n"
}</lang>
Substitute using <tt>regsub</tt>
<lang tcl>set theString = "I am a string"
▲ set theString = "I am a string"
▲ puts [regsub -- { a } {I am a string} { another }]
=={{header|Toka}}==
|