For whatever reason, I decided to start working on a Regex Parser. Though, I did something funny… for testing I allowed for statically compiled regexes to be defined. This caused some rather crazy code:
Regex_Hack::Regex reg( "Integer", //Value, used for name
Regex::ONE, //times to find in a row...
Regex::ROOT, //root node, basically says to ignore the previous two arguments
//Following == [1-9][0-9]*
Regex_Hack::Group(Regex_Hack::Regex::ONE, //repeat finding of group once only
Regex_Hack::Range('1','9') //range of numbers 1-9 repeated once ([1-9])
<< //craziness to solve variadic argument problem... basically rigged an ostream
Regex_Hack::Digit(Regex_Hack::Regex::ZERO_OR_MORE))); //range 0-9 repeated zero+ ([0-9]*)
Advertisement