Quote:
I don't think that's the best example as I think his idea would be valid in that it would fail because there is more after the *X*X match unless a * follows that: *X*X*.
This is exactly why I said the stuff about prefix/suffix checks. In this example, *X*X succeeds. To determine if this is right, check whether the substring after the last * in the pattern is a suffix of the text. If it isn't, return 'failure', otherwise 'success'.

I implemented all of this and so far it seems to work correctly. (I've tested it with a lot of pattern/text pairs. I'll run some more tests to make sure but it looks good.)

There are other approaches too (for example the routine used in Saturn's io.dll, which I saw just today) that avoid trying all possible combinations (ie recursive backtracking). Any of these can certainly be used in mirc, so RRX was right, his example string doesn't have to be slow.