Why not use operator overloading?
( Rx.Rx("[ \t\n\r\f\v]") | Rx.Rx("//[^\n]*\n") | Rx.Rx("/\*([^*]|\*[^/])*\*/") ) * Rx.inf
Btw, I tried doing this to emulate pipes recently, and found out that I can't make an `< operator which returns an object.. Kind of annoying as I wasn't planning to use `< for comparisons.
I was trying to do something like:
( Cmd("grep foo") < Stdio.File("foo.txt") | Cmd("uniq") > mysocket ) ->run();
Any ideas for how to get around the type restrictions in `< and other lfuns?
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-09-21 14:49: Subject: wish: string with other quoting then \
As if it would be any less learning with a new string syntax? In either case the user has to come to terms with nonstandard (as in non-C and non-regex) syntax.
My personal belief when it comes to regexps is that it's simpler to live with than to try to improve. For very complicated regexps I think the right way is to use something completely different and only use the cryptic strings for smaller parts. E.g:
Rx.Rx syntactic_ws = Rx.Rx ( Rx.rep (Rx.or ("[ \t\n\r\f\v]", // Ordinary whitespace. "//[^\n]*\n", // Line comments. "/\*([^*]|\*[^/])*\*/" // Block comments. )));
/ Martin Stjernholm, Roxen IS