I assume that this was supposed to be: =~ m/\s*(?:y|(ok))/i
I did.
But this is hardly easier than 'eq'.
Easier for the programmer? Of course not! Heh, when I say better I mean better for the user, and therefore a better bit of software. Programmers are just staff, but users are people :-)
I agree that accepting " y", " Y", "my mother" is all well and good from a usability standpoint, but I believe that the original context of this thread was simply whether or not regexs are hard and how well they perform (or, conversely, how poorly they perform when they aren't well-formed).
> To not do so is broken, end of story. It baffles me that some people think
> in the year 2003 it's OK to have software that does this:
I would agree with you on this, but it makes the assumption that we're discussing user-interactions. Funnily enough, my assumption was that 'y' came from some kind of flat-file in which it might be the result of some kind of form input (e.g. radio button) or log data, but I guess that's because I've spent too long working with ETL code and not people. ;)
jon
-- jon reades fulcrum analytics t: 0870.366.9338 m: 0797.698.7392 f: 0870.888.8880
lower ground floor 2 sheraton street london w1f 8bh