The Tcl language is built around strings Ð everything is a string! In this module we look at basic string handling commands, the string command itself which provides a flexible selection of facilities, and we introduce regular expressions for pattern matching.
This topic is presented on public course
Tcl Basics
Examples from our training material
| ac_report | Complete example - Access log file analysis |
| apfo | format and append commands |
| brax | Literally matching round brackets in regular expressions |
| ccat | lappend and concat - the difference |
| datematch | Matching a date using a regular expression |
| dm2 | A further date match example |
| hunter | Example of analysis of a log file |
| iconfinder | search for all icon references in a web log |
| match | String matching - using globbing |
| rematch | String matching using a regular expression |
| rf | Opening and reading a file |
| rf2 | Using scan to get a field from a string |
| rf2a | Using scan's return value |
| stringinfo | Getting information from a text string |
| stringman | Manipulating a string |
More web pages on this subject
Regular Expressions in Tcl
Opentalk forum discussions related to this topic
regexp for multi line matchingreg parsingRegexp helpDifference between a binary string quot and a quot stringexpect reading in a listegrep from a variablString match toRegular ExpressionsNo Split WordsLong String to ASCIIHelp wanted for using quot Scan quot commandDecimal to Hexadecimal conversion
Pictures
String matching in Tcl
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
http://www.training-notes.co.uk.
Topics covered in this module
Basic string handling commands.
scan.
Append and format.
The string command.
Subcommands.
Indexes.
Informational subcommands.
Manipulating subcommands.
The match subcommand and globbing.
Putting string together.
Regular expressions.
The elements of a regular expression.
Literals.
Character sets.
Counts.
Anchors.
Groupings and Alternation.
Manipulating matched regular expressions.
Extracting from a match.
Match and substitute.
Putting it together.
Looking forward.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Tcl/Tk, Expect,
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 600 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.