On Wed, 16 Dec 2009 13:06:42 +0000, Ximin wrote:

>Damián Viano wrote:
>>> In "try to replace me with \t", with Find = "me":
>> 
>> This is the result with:
>> "Use regular expressions" ON
>> "Use escape sequences"    OFF
>> 
>>> Replace = "\t" replaces "me" with a tab
>>> Replace = "\\t" replaces "me" with a backslash followed by a tab
>>> Replace = "\\\t" replaces "me" with two backslashes followed by a
>>> tab
>> 
>> "Use regular expressions" ON
>> "Use escape sequences"    ON
>> 
>> Replace = "\t" replaces "me" with a tab
>> Replace = "\t" replaces "me" with a tab
>> Replace = "\\t" replaces "me" with a backslash followed by a tab
>- the above 2 examples are wrong; "\t" should be "\\t" and "\\t"
>should be "\\\t"
>
>Right, but what if you want to search for a regular expression, *AND*
>replace it with something containing the literal "\t"? The above
>examples cannot do this.
>
>In any case, if escape sequences are ON, then "\\" should be escaped
>to "\" regardless of whether regexp is on or not. Actually it should
>only an option for non-regexp; it should be implicitly ON when you use
>regexp, as is standard in every other implementation.

I had a short look at your examples but to be honest for me this is
just not that important. I surely can find more corner cases where the
one or the other regexp/special character combination won't work.
Either you write a patch to make things better or you maybe just use
tools which are more specialised for such tasks like grep, sed and
friends.


>I suggest using an already-made regexp library instead. Eg. libpcre,
>or the code from GNU grep (which does not have exponential
>corner-cases - see http://swtch.com/~rsc/regexp/regexp1.html).

You also said Geany were 'trying to implement its own regexp engine'.
This is wrong.
Geany uses the regexp implementation of Scintilla, the used editing
component. It's not as good as it could be but it does the job and it
doesn't pull in new, external dependencies like libpcre.
Please read the documentation to learn more about the use of regular
expressions within Find and Replace dialogs in Geany. There are some
limitations and differences but generally it just works.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.asc

Attachment: pgpFFOriWyNSD.pgp
Description: PGP signature

_______________________________________________
Geany-devel mailing list
Geany-devel@uvena.de
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to