> It's the unexpected that I'm thinking about. How do you make
> it so that it will match anything other than your token? This
> doesn't seem to work:
>
> regex = Regexp.new(
> "(?m:" << tokens.map { |t|
> Regexp::escape(t)
> }.join("|") << "|.*)"
> )
> scan(regex)
Try /./ instead of /.*/. Unexpected stuff will come at you one character at
a time, which may or may not be ok. Otherwise you can be more creative in
your Regexps. For example, if all you are interested in are patterns like
"some_var = some_thing_else", then end your token list with something like
/[^a-zA-Z0-9_=]*/. If you want white space, then include white space in
your list of tokens.
--
-- Jim Weirich / Compuware
-- FWP Capture Services
-- Phone: 859-386-8855