The ruby regexp highlighting works much better now, but still gets confused by something like:
%r{hel{2,10}o}
(The highlighting stops at the first "}").
Adding this:
{ name = "Arbitrary repetition"; match = "({\d+(,\d+)?})"; foregroundColor = "#CCCC33"; }
to the Regular Expression II set in Ruby.plist appears to sort this. Doesn't work if you have a regexp like this though:
%r{foo{2,10}
Admittedly it's a bit of an extreme edge case, but if someone with better regexp skillz feels like figuring it out...
(Note: I don't subscribe to this list, but do check the archives every so often.)
- Peter
On 18. Oct 2004, at 0:45, Peter McMaster wrote:
Doesn't work if you have a regexp like this though: %r{foo{2,10}
Okay, I've added these two sub-patterns: { name = "Escaped Characters"; match = "\."; }, { name = "Arbitrary repetition"; match = "\{\d+(,\d+)?\}"; },
The first eats all escaped characters, so it'll now also work with: %r{foo}bar}
The second eats the counted repetition construct you suggested.
There may still be a problem with { or } inside [] though.
Kind regards Allan