Patch (unofficial): OLE SNIFF enabled gvim crashes on Windows by closing
Patch (unofficial) Problem:OLE SNIFF enabled gvim crashes on Windows by issuing the command :q after 10 minutes Solution: Do translate and dispatch all messages. They may be addressed to some thread of hidden window created by the os. Files: src/gui_w48.c *** ..\vim-7.0.000\src\gui_w48.c2006-05-07 16:13:02.0 +0200 --- src\gui_w48.c 2006-06-12 12:17:56.160569600 +0200 *** *** 1664,1670 --- 1664,1674 /* request is handled in normal.c */ } if (msg.message == WM_USER) + { + MyTranslateMessage(msg); + DispatchMessage(msg); return; + } #endif #ifdef MSWIN_FIND_REPLACE
Extra file descriptor callbacks
Hello all, I am involved in a project that has embedded ECL (http://ecls.sourceforge.net/), a Lisp interpreter into Vim. Our end goal for the project involves having Lisp code inside of Vim respond to incoming data from a socket, so we also have a patch that allows us to register callbacks that will be triggered when we receive data on a file descriptor. The code for this is here http://theclapp.org/repos/. The async callback patch only really works for GTK and console I think. Basically all the patch does is add a few more file descriptors to poll/select on during Vim's read_char, if the appropriate descriptor is triggered then we get a callback to Lisp. The callbacks all appear to work fine, for example you can setup a listening socket in Vim and have data output to a Vim buffer without any problems. But there is a bug. Lets assume that we have a server that simply echoes back data, and a client that sends data. Data flow is something like: (CLIENT) Embedded Lisp script sends data (SERVER) Echoes data back (CLIENT) Still sending data, there is also pending data coming back from the server (CLIENT) Finishes sending data, next time through the read_char loop should trigger call back which will read data out from the socket. However, the CLIENT side crashes in this scenario, it appears to crash inside the Lisp interpreter. I suspect that somehow the last two phases above are overlapping, and the interpreter is being re-entered, which I don't think it supports. However, I don't see how this can be happening - as far as I am aware Vim is totally single threaded (at least *nix console builds), so the behaviour should be deterministic, the data will finish sending, continue out to the main loop and then trigger the callback. I know it is a lot to ask for help on such a modified Vim, but this is really starting to get me down. I would really appreciate any thoughts about what might be going on, or how to debug this. Cheers Brad
vim documentation about marks/file-marks
Suggestion: change === *m* *mark* *Mark* m{a-zA-Z} Set mark {a-zA-Z} at cursor position (does not move the cursor, this is not a motion command). *'* *'a* *`* *`a* '{a-z} `{a-z}Jump to the mark {a-z}. *'A* *'0* *`A* *`0* '{A-Z0-9} `{A-Z0-9} To the mark {A-Z0-9} in the correct file (not a motion command when in another file). {not in Vi} === to === *m* *mark* *Mark* m{a-z} Set buffer only mark {a-zA-Z} at cursor position *file-mark* m{A-Z0-9} Set vim wide mark (jump also to correct file) m (does not move the cursor, this is not a motion command). *'* *'a* *`* *`a* '{a-zA-Z0-9} `{a-zA-Z0-9} Jump to the mark {a-zA-Z0-9}. === because you define the mark first before using it. If you read that you can jump to a file-mark using 'A you will definitely show how to define it.. ;) But I should not have searched not only for buffer but also for file.. Thanks to tpope for pointing my mind in the right direction ;) What do you think.. ? Marc
Re: Problem with example in :help complete()
On Mon, 12 Jun 2006, A.J.Mechelynck wrote: Gerald Lai wrote: On Sun, 11 Jun 2006, A.J.Mechelynck wrote: Gerald Lai wrote: Hi all, [On Windows Vim 7.0, binary at ftp://ftp.vim.org/pub/vim/pc/gvim70.exe] I'm having trouble getting the example in :help complete() to work. When I hit F5 in Insert mode, I get this: Error detected while processing function ListMonths: line 1: E523: Not allowed here I have :set nosecure. Having this instead fixes the problem: inoremap F5 C-r=ListMonths()CR Looks like a bug. I wasn't sure if this has been fixed. -- Gerald Looks to me like a documentation bug. I believe you got it right, and the helpfile got it wrong. Best regards, Tony. Does this mean that expr isn't allowed for complete()? It mentioned at the top of :help complete() that both :map-expr and C-r= were allowed. Isn't imap expr F5 MyFunction() and imap F5 C-r=MyFunction()CR pretty much the same? Or at the very least, the same in terms of security (see :help E523)? -- Gerald Sorry, the expr in the given example had escaped me. They /ought to/ be synonymous, but the C-R= mechanism is older; expr is new in version 7, which means perhaps it hasn't yet got all its bugs ironed out. :help E523 is the same as :help 'secure'. Are you sure this option isn't set unbeknownst to you? When the error happens, what does :verbose set secure? (without the quotes but with the question mark) reply? If it does return nosecure then I guess it's a bug. Yes, it does return nosecure. Everything unchanged, when I tried the C-r= version, it works. It looks like a bug from my side. Do you notice the same? Anybody else? -- Gerald
negative match pattern, again
I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. I think I need to use \ ^.*foo\^XXX$ and then put, in place of XXX, the pattern that matches anything not containing /)\s*;/. How do I express it in vim. Yakov I'd write \([^)]\|)\S\|)\s*[^;]\) failing other things.
Re: negative match pattern, again
I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. Well, there are several ways to go about it. One would be to use Dr. Chip's logipat script: http://vim.sourceforge.net/scripts/script.php?script_id=1290 Another would be to use something like :g/foo/if getline(.)!~'blah' | print getline(.) | endif which would search for lines that do contain foo, but don't contain blah. I don't know about using the \ atom. There might be a solution with that as well, but for negating matters, it becomes trickier. -tim
Re: negative match pattern, again
On Mon, Jun 12, 2006 at 02:42:18PM +, Yakov Lerner wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. I think I need to use \ ^.*foo\^XXX$ and then put, in place of XXX, the pattern that matches anything not containing /)\s*;/. How do I express it in vim. Yakov I'd write \([^)]\|)\S\|)\s*[^;]\) failing other things. How about preceding 'foo' with '\(...\)\@!' and following it with '\(...\)[EMAIL PROTECTED] as in /\()\s*;.*\)\@!foo\(.*)\s*;\)[EMAIL PROTECTED]/ HTH --Benji Fisher
Re: negative match pattern, again
On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. Well, there are several ways to go about it. One would be to use Dr. Chip's logipat script: http://vim.sourceforge.net/scripts/script.php?script_id=1290 LogiPat does wonders. Thanks. For the record, :echo LogiPat('foo!bar') produces: \%(.*foo.*\^\%(\%(bar\)[EMAIL PROTECTED])*$\) Yakov
Re: Positioning on a given char offset
Hi Fabio Eg. it does not warn me about an error on line 12, but at the char 2032 Is there any command in Vim to position to that char offset? Maybe :2032go ? With kind regards Mathias
Re: Positioning on a given char offset
Fabio Rotondo wrote: Hi, I have this problem: a program of mine is giving me error positions based on the file offset and not the line containing the error. Eg. it does not warn me about an error on line 12, but at the char 2032 Is there any command in Vim to position to that char offset? Thanks, Fabio :go 2032 (with colon), or 2032go (without colon) Requires +byte_offset feature, i.e., has(byte_offset) must return a nonzero value, normally 1. This means Normal, Big or Huge features. see :help go HTH, Tony.
Re: Positioning on a given char offset
I have this problem: a program of mine is giving me error positions based on the file offset and not the line containing the error. Eg. it does not warn me about an error on line 12, but at the char 2032 Is there any command in Vim to position to that char offset? If the data is on one line, the pipe command takes a column offset, so in normal mode, just use 2032| (that's two zero three two pipe) A fabulous feature when you're dealing with data where columns matter (as in column-delimited data files) that drives me nuts when I don't have it in other editors. Score yet one more point for vim. :) If the data is *not* all on one line, you can use [count]go in normal mode, or :[count]go in Ex mode to go to the particular byte-offset in the file. So in your case, you can just use 2032go or :2032go or :go 2032 You can learn more at :help bar :help :go -tim
Re: negative match pattern, again
Yakov Lerner wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. I think I need to use \ ^.*foo\^XXX$ and then put, in place of XXX, the pattern that matches anything not containing /)\s*;/. How do I express it in vim. Yakov I'd write \([^)]\|)\S\|)\s*[^;]\) failing other things. May I suggest that you try LogiPat out: http://vim.sourceforge.net/scripts/script.php?script_id=1290 or at http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs (see LogiPat) (as always, my website has the most up-to-date version) In this case, :echo LogiPat('foo !)\s*;') yields \%(.*foo.*\^\%(\%()\s*;\)[EMAIL PROTECTED])*$\) Regards, Chip Campbell
Re: negative match pattern, again
On 6/12/06, Benji Fisher [EMAIL PROTECTED] wrote: On Mon, Jun 12, 2006 at 02:42:18PM +, Yakov Lerner wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. I think I need to use \ ^.*foo\^XXX$ and then put, in place of XXX, the pattern that matches anything not containing /)\s*;/. How do I express it in vim. Yakov I'd write \([^)]\|)\S\|)\s*[^;]\) failing other things. How about preceding 'foo' with '\(...\)\@!' and following it with '\(...\)[EMAIL PROTECTED] as in /\()\s*;.*\)\@!foo\(.*)\s*;\)[EMAIL PROTECTED]/ Benji, Im not sure the post-foo part works. I think it will give the false match whenever it something after foo that does not match )\s*;. This is not what I wanted. Yakov
Re: negative match pattern, again
On 6/12/06, Gerald Lai [EMAIL PROTECTED] wrote: On Mon, 12 Jun 2006, Gerald Lai wrote: On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. Well, there are several ways to go about it. One would be to use Dr. Chip's logipat script: http://vim.sourceforge.net/scripts/script.php?script_id=1290 LogiPat does wonders. Thanks. For the record, :echo LogiPat('foo!bar') produces: \%(.*foo.*\^\%(\%(bar\)[EMAIL PROTECTED])*$\) Yakov In addition to the regex above, you can also do: /^\%(.*)\s*;\)[EMAIL PROTECTED] It's a little shorter, and probably a little faster since the LogiPat regex does a \%(..\)* for every character position of the line. The speed is evident for a long line. It follows the general form of a negative line search for embedded search: /^\%(.*[limit0.*]search[.*limit1]\)[EMAIL PROTECTED] For example, to match a line that contains foo but does not contain bar between big and tummy: /\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Sorry, I missed the ^ anchor: /^\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Is the trailing .* necessary there ? Why ? Yakov
Re: negative match pattern, again
On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Gerald Lai [EMAIL PROTECTED] wrote: On Mon, 12 Jun 2006, Gerald Lai wrote: On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. Well, there are several ways to go about it. One would be to use Dr. Chip's logipat script: http://vim.sourceforge.net/scripts/script.php?script_id=1290 LogiPat does wonders. Thanks. For the record, :echo LogiPat('foo!bar') produces: \%(.*foo.*\^\%(\%(bar\)[EMAIL PROTECTED])*$\) Yakov In addition to the regex above, you can also do: /^\%(.*)\s*;\)[EMAIL PROTECTED] It's a little shorter, and probably a little faster since the LogiPat regex does a \%(..\)* for every character position of the line. The speed is evident for a long line. It follows the general form of a negative line search for embedded search: /^\%(.*[limit0.*]search[.*limit1]\)[EMAIL PROTECTED] For example, to match a line that contains foo but does not contain bar between big and tummy: /\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Sorry, I missed the ^ anchor: /^\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Is the trailing .* necessary there ? Why ? Nope, not necessary for :g//. I left it there for hlsearch appeal ;) HTH. -- Gerald
Re: negative match pattern, again
Gerald Lai wrote: On Mon, 12 Jun 2006, Gerald Lai wrote: On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. Well, there are several ways to go about it. One would be to use Dr. Chip's logipat script: http://vim.sourceforge.net/scripts/script.php?script_id=1290 LogiPat does wonders. Thanks. For the record, :echo LogiPat('foo!bar') produces: \%(.*foo.*\^\%(\%(bar\)[EMAIL PROTECTED])*$\) Yakov In addition to the regex above, you can also do: /^\%(.*)\s*;\)[EMAIL PROTECTED] It's a little shorter, and probably a little faster since the LogiPat regex does a \%(..\)* for every character position of the line. The speed is evident for a long line. It follows the general form of a negative line search for embedded search: /^\%(.*[limit0.*]search[.*limit1]\)[EMAIL PROTECTED] For example, to match a line that contains foo but does not contain bar between big and tummy: /\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Sorry, I missed the ^ anchor: /^\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Hello! These two regex's produce different results; I'm using foo and bar instead of foo and )\s*;, because its more human readable... To see the results, use: vim tst :set hls :so pat1 :so pat2 (also, use a fixed font to see this properly in the email) -- tst --P1--P2- foo * * bar foo junk* * bar junk junk foo* * junk bar foo junk bar* bar junk foo -- pat1 /^\%(bar\)[EMAIL PROTECTED] -- pat2 /\%(.*foo.*\^\%(\%(bar\)[EMAIL PROTECTED])*$\) -- To summarize: Gerald's pattern (P1, pat1) matches the same three that LogiPat's (P2, pat2) does, plus it allows one line that P2 rejects. Regards, Chip Campbell
Re: negative match pattern, again
On Mon, 12 Jun 2006, Charles E Campbell Jr wrote: Gerald Lai wrote: On Mon, 12 Jun 2006, Gerald Lai wrote: On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. Well, there are several ways to go about it. One would be to use Dr. Chip's logipat script: http://vim.sourceforge.net/scripts/script.php?script_id=1290 LogiPat does wonders. Thanks. For the record, :echo LogiPat('foo!bar') produces: \%(.*foo.*\^\%(\%(bar\)[EMAIL PROTECTED])*$\) Yakov In addition to the regex above, you can also do: /^\%(.*)\s*;\)[EMAIL PROTECTED] It's a little shorter, and probably a little faster since the LogiPat regex does a \%(..\)* for every character position of the line. The speed is evident for a long line. It follows the general form of a negative line search for embedded search: /^\%(.*[limit0.*]search[.*limit1]\)[EMAIL PROTECTED] For example, to match a line that contains foo but does not contain bar between big and tummy: /\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Sorry, I missed the ^ anchor: /^\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Hello! These two regex's produce different results; I'm using foo and bar instead of foo and )\s*;, because its more human readable... To see the results, use: vim tst :set hls :so pat1 :so pat2 (also, use a fixed font to see this properly in the email) -- tst --P1--P2- foo * * bar foo junk* * bar junk junk foo* * junk bar foo junk bar* bar junk foo -- pat1 /^\%(bar\)[EMAIL PROTECTED] -- pat2 /\%(.*foo.*\^\%(\%(bar\)[EMAIL PROTECTED])*$\) -- To summarize: Gerald's pattern (P1, pat1) matches the same three that LogiPat's (P2, pat2) does, plus it allows one line that P2 rejects. In the same context, pat1 should instead be: /^\%(.*bar\)[EMAIL PROTECTED] and both patterns match the same. -- Gerald
Re: negative match pattern, again
Gerald Lai wrote: In the same context, pat1 should instead be: /^\%(.*bar\)[EMAIL PROTECTED] and both patterns match the same. And so they do! (with your pattern having .* again, which is unnecessary for :g... as you mentioned). Regards, Chip Campbell
Re: Calling through a function reference with a variable argument list
On Mon, 12 Jun 2006 at 4:07pm, Charles E Campbell Jr wrote: Bob Hiestand wrote: On 6/2/06, Charles E Campbell Jr [EMAIL PROTECTED] wrote: Bob Hiestand wrote: My question is whether there is a simpler way to pass an unknown number of arguments from the current function to a function which accepts a variable-length list of arguments. ...snip... I don't think that does what I wanted, though I may have misunderstood the implications. That converts the arguments into a string representation of a list, which then becomes the single argument to the second function. Looks like I made a mistake. Here's one that does illustrate passing a variable number of arguments along: -- fun! AFunc(...) let args = string(a:000) let len = strlen(args) let args = strpart(args,1,len-2) echomsg call BFunc(.args.) a:0=.a:0 exe call BFunc(.args.) endfun -- fun! BFunc(...) echomsg BFunc sees: a:0=.a:0 echomsg a:000.string(a:000). endfun -- echomsg 'AFunc(1):' call AFunc(1) echomsg 'AFunc(1,a):' call AFunc(1,a) echomsg 'AFunc(1,a,b):' let b=BBB call AFunc(1,a,b) The idea is to have a string hold just the arguments, not the list delimiters. The exe squeezes the string together and then executes it. Consequently, the output is: AFunc(1): call BFunc(1) a:0=1 BFunc sees: a:0=1 a:000[1] AFunc(1,a): call BFunc(1, 'a') a:0=2 BFunc sees: a:0=2 a:000[1, 'a'] AFunc(1,a,b): call BFunc(1, 'a', 'BBB') a:0=3 BFunc sees: a:0=3 a:000[1, 'a', 'BBB'] P So you can see that BFunc is being called with a variable number of arguments depending on whatever AFunc received (look at the BFunc sees: lines) I don't know if the OP can use a Vim7.0 only solution, but the genutils plugin has a utility to make this possible for prior versions. I have been using this in several places of one of my plugins with no issues. However, if Vim7.0 only solution is acceptable, Vim supports this already with the call() function. -- fun! AFunc(...) echomsg call BFunc(.string(a:000).) a:0=.a:0 call call('BFunc', a:000) endfun -- fun! BFunc(...) echomsg BFunc sees: a:0=.a:0 echomsg a:000.string(a:000). endfun -- HTH, Hari My intention was to create a passthrough function that could call any other function after determining the function to which it would dispatch control (the application here is a general source integration script that would dispatch to the appropriate function specific to the version control system controlling the current file). As it turns out, I was a victim of narrow thinking because I was trying to modify as little as possible of an existing plugin. The correct change was to simply make the dispatch function and the end functions accept a list as the parameter, in which case pass-through becomes trivial. Thank you for looking at this, You're welcome! Chip Campbell __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: non-latin characters aren't displayed correctly in Windows menu
Mojca Miklavec wrote: On 6/12/06, A.J.Mechelynck wrote: Mojca Miklavec wrote: Hello, I translated the menus for gvim and wanted to use them under windows, but the non-latin characters simply don't show in the menu (other characters are shown instead: squares š and ž and some other character for č). All other programs under Windows work fine, the encoding should also be OK (If I rename the Russian file to menu_sl_si.utf-8.vim, I only get question marks in menu, but I saw other cyrillic programs running on the same computer without any problems as well). I suspect that Vim might be asking Windows for Western European font for the menu. I'm not sure about it, but in any case it's a bit weird. Is there any remedy for it? Any hints would be appreciated, Mojca Miklavec You must make sure that you have: - an 'encoding' which includes the non-Latin characters you want to use - (in console Vim) a terminal code page which includes them What is that? And console vim if you mean the one without GUI menus is not always there (I have it one one computer, but not on the other). Console Vim is the one without GUI. On Windows a different executable must be used, usually named vim.exe (or possibly something starting in vim as in vimd.exe for a debug version etc.); it displays in a Dos Box. On Unix a single executable can be used as a GUI (through X11) or as a console version (displaying on /dev/tty or on xterm, konsole, etc.) depending on how it is invoked. - (in gvim) a 'guifont' which has the glyphs for them. I have that (the default font is OK), but in Menu another font is used (some default Windows font which is the same in all the applications). Check 'encoding' and 'guifont' by means of :verbose set encoding? guifont? encoding=utf-8 Last set from D:\soft\_vimrc guifont= [some parts deleted] 'guifont' empty means some default system font, such as Fixed. IMHO it is not he prettiest but if you're satisfied with it you may stay with it. 3. check that there is a line scriptencoding utf-8 near the top of the file, before the first non-Latin character It is. 4. save the file with :saveas ++enc=utf-8 ~/.vim/lang/menu_sl_si.utf-8.vim (on Unix) or :saveas ++enc=utf-8 ~/vimfiles/lang/menu_sl_si.utf-8.vim (on Windows) (without hte quotes in either case). I didn't use that, but it seems to be in UTF-8. I guess that the problem is not related to the vim itself, but rather to the Windows GUI, so the file might work properly on Mac or Linux. I've seen no options to modify the menu font (I did, but I had the impression that that works only in Linux). There is a -menufont {font} command-line option, but from where it is described in the help I fear it is only applicable to X11 (all Unix/Linux versions and possibly some MacOsX versions). AFAIK the font used for menus in Windows is common to all applications and thus outside the reach of gvim. Try the following: gvim -N -u NONE :language messages :set encoding? This will tell you which language and charset settings are passed by Windows to gvim before any vimrc or other script changes them. If they are not compatible with what you want to display in the menus, you will need to change the country-specific settings before starting Windows. I think the settings are to be found in the international keyboard widget, probably configured under Control Panel - Keyboard, then choose a language and keyboard layout from the system tray; but I might be wrong. See http://vim.sourceforge.net/tips/tip.php?tip_id=246 :help ++opt :help :scriptencoding Can please anybody check the attached file? It seems to me that it IS in utf-8, but I might be wrong. I'm only sending the Tools menu. Instead of Skoči nazaj I see Skoèi nazaj and instead of Pokaži napake I get Poka[]i napake, where [] stands for a box. Can anyone get the content right? Thanks a lot, Mojca I don't know the language it's in, but, when I view it in gvim, it sets 'fileencoding' to utf-8 and the contents look like some mixture of English and some Slavic-family language using Latin alphabet with diacritics (mostly c, s and z, all three with caron). If you _see_ it as something else when you _edit_ it, then either you don't have 'encoding' and 'fileencoding' set both to utf-8, or your 'guifont' lacks some necessary glyphs. If you see it OK when _editing_ but not in the _menus_ then see above about the Windows settings. Best regards, Tony.
Re: negative match pattern, again
It follows the general form of a negative line search for embedded search: /^\%(.*[limit0.*]search[.*limit1]\)[EMAIL PROTECTED] For example, to match a line that contains foo but does not contain bar between big and tummy: /\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Learn a lot more about regexp from this post. Thanks! Sorry, I missed the ^ anchor: /^\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Just a question, why it is necessary to have the ^ anchor? Isn't .* already includes the characters start from the beginning of the line? Sorry if I'm asking a stupid one -- Ed