in reply to regexp golf - homework
Interesting problem, and ++ for admiting it was homework!
I'm a little stumped by this one myself. If the problem were inverted ("Write a regexp that matches strings containing matching digits"), it would be a lot easier:
/(0.*0)|(1.*1)|(2.*2)|(3.*3) ... (you get the idea)
I'm curious, do regular expressions have an equivalent of Demorgan's law in boolean expressions that allows you to invert an expression?
Best of luck to you, please let us know what you find out.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: regexp golf - homework
by no_slogan (Deacon) on Feb 02, 2002 at 22:37 UTC |