Nevermind, I think I figured it out: "\" must be a Lua escape too, so that you need to write "^\\[" in order for Lua to generate the string "^\[" to feed the SciTE search. (This is slightly diabolical :-))
Thanks for steering me in the right direction, GF On 3/26/07, george fotheringay <[EMAIL PROTECTED]> wrote:
Neil and Mitchell, On 3/26/07, Neil Hodgson <[EMAIL PROTECTED]> wrote: > george fotheringay: > > > I'm using Lua to find occurrences of lines which begin with the > > character "[", via the call > > editor:findtext(pattern,SCIFIND_REGEXP,position), > > where pattern is the string "^\[". > > Maybe you need to escape the '\': "^\\[". > > Neil To my complete amazement, "^\\[" worked. But I don't understand why. I'm not trying to search for an occurrence of "\". "[" is a metacharacter; therefore to search for it, it must be escaped. "\" is the escape character. The documentation says that escape followed by any character (other than some exceptions which do NOT include "[") matches that character. Both of you knew what to do-- can either of you explain this? perplexed, GF
_______________________________________________ Scite-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scite-interest
