home *** CD-ROM | disk | FTP | other *** search
/ Practical Programming in Tcl & Tk (4th Edition) / TCLBOOK4.BIN / pc / exsource.old / 11_2.tcl < prev    next >
Text File  |  2003-04-15  |  182b  |  15 lines

  1. #
  2. # Example 11-2
  3. # Using regular expressions to parse a string.
  4. #
  5.  
  6. set env(DISPLAY) sage:0.1
  7. regexp {([^:]*):} $env(DISPLAY) match host
  8. #=> 1
  9. set match
  10. #=> sage:
  11. set host
  12. #=> sage
  13.  
  14.  
  15.