[TxMt] Re: Python interpretation of raw strings as regexes

Jacob Rus jacobolus at gmail.com
Wed Aug 15 02:09:22 UTC 2007


Fabry Nicholas F. wrote:
>>> I'm more and more convinced as time goes on that we should just stop 
>>> trying to interpret raw strings as regexps.
>>
>> I think you are probably right.  Does anyone else have an opinion on 
>> this?
>
> Or will we just ditch regex syntax 
> highlighting from Python altogether?

This was my thought.  I dunno... I don't tend to use raw strings for 
anything else, or at least nothing else with conflicting syntax, so it's 
not *that* much of a problem for me personally.  But several people have 
had highlighting break on various stuff because of the regexp highlighting.

> So, perhaps raw strings should only be interpreted as regexes when 
> directly preceded by re.[function]( - while this would not get 
> everything we might want to be interpreted as a regex, it would capture 
> some of the most common use cases.

This would be fine too (i.e. cause no problems), but would complexify 
the grammar.

-Jacob




More information about the textmate mailing list