Posted to tcl by kbk at Mon Mar 24 16:55:37 GMT 2008view raw

  1. {
  2. ^ # start of string
  3. (?:
  4. "(
  5. (?:[^"]|\\")+ # first match - a string in double quotes
  6. )"
  7. |
  8. ([^\s]+) # (alternative) second match - a string
  9. # of nonblank chars
  10. )
  11. [ ] # space
  12. (.+)$ # rest of string
  13. }