Plus, the term regnx looks suspicious: aren't you seeking help on regular expressions and pattern matching?
Then better ask your question in either "Advanced Language Topics" or "Algorithms". This forum is definitely not about the same type of "patterns"! ;-)
Good luck anyway.