[TxMt] Re: Regexp generator for language grammars wanted

Hans-Jörg Bibiko bibiko at eva.mpg.de
Mon Sep 22 14:15:18 UTC 2008


On 22.09.2008, at 15:47, Timothy Bates wrote:

> could use teaching about some options like (?i) - which makes the
> search case-insensitive
>
> \b(?i)(Boundary|CMatrix)\b
>
> should probably go to either
> options: (?i)
> \bBoundary\b
> \bCMatrix\b
>
> or
> \b(?i)Boundary\b
> \b(?i)CMatrix\b
>
> but instead the boundary condition is stuck to the first line and a
> raw 'i' is prefixed to each word, and the trailing \b is lost.
>
> \b?iBoundary
> iCMatrix

Tim,

my decompileRe script ONLY works for an optimized regexp string for  
FIXED keywords (optimized by Allan's script) WITHOUT any (?i), \b, \s,  
etc. stuff. My only goal was to decompose such a regexp string for  
updating it.

If you have something like
\b(?i)(Boundary|CMatrix)\b

you can try to select only:
Boundary|CMatrix

and invoke that script, modify that list, invoke the optimize script,  
and replace the old stuff manually. In other words you can do it only  
portion by portion.

I would say to parse e.g. (?i) stuff could be possible maybe BUT it  
would goes beyond that scope.
How to parse e.g.:
NS(?i)(Boundary|CMatrix|(?-i)AMatrix)

AND if one could do this how to optimize it??


--Hans







More information about the textmate mailing list