package require nre ?3.0? nreforeach varname regexp string body
If regexp contains ``()'' then each captured string will be lappended to varname. You can keep a subexpression from being appended by using ``(?:)'' instead of ``()''.
See the nrematch man page for a description of regular expressions. nreforeach is implemented using the nrematch command with the -eval -all and -flatten switches. See the nrematch for details on how you can create your own version of nreforeach with additional features.
Copyright © 1997 Darrel Schneider.