From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: Word Boundary problem with regex Date: Mon, 06 Jun 2005 00:55:10 +0200 Organization: [posted via Easynet Spain] Message-ID: <87vf4s5s8h.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118012093 15727 80.91.229.2 (5 Jun 2005 22:54:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 5 Jun 2005 22:54:53 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 06 00:54:44 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Df40r-00053F-0T for geh-help-gnu-emacs@m.gmane.org; Mon, 06 Jun 2005 00:54:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Df472-0004lS-PY for geh-help-gnu-emacs@m.gmane.org; Sun, 05 Jun 2005 19:01:00 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!freenix!oleane.net!oleane!easynet-quince!easynet.net!easynet-post2!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:IkThrSpIIvnETfbXKLlNaJMDPgg= Original-Lines: 36 Original-NNTP-Posting-Host: 62.93.174.79 Original-X-Trace: DXC=@_^>FEdVB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:27246 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:27246 Tim Johnson writes: > In case of word wrapping the text between (but not including) the lines > of asterisks should be on one line: > > I am using the following expression > ******************************************************************************* > \\([^][ \t\r\n{}()]+\\):[ ]*\\(d\\(ef\\|oes\\)\\|func\\(tion\\)\\|has\\|sub?\\) > ******************************************************************************* > > To colorize the following words: "def" "does" "func" "function" "has" > "sub" - which define subroutines. > > When I type the following: test: def[val][print val], "def" is > colorized properly. One would exect that adding a letter to "def" would > turn off the target color, but does not. This suggests to me that > I have not properly defined the word boundary in the expression above. > > Can anyone tell me what I am doing wrong? > > FYI: This is for the rebol programming language (www.rebol.com), it > should be noted that in lispish fashion, a subroutine is an > expression, not an immutable control structure. Just add "\\>" at the end. You don't need "\\<" at the beginning since you're matching spaces and special characters. -- __Pascal Bourguignon__ http://www.informatimago.com/ Until real software engineering is developed, the next best practice is to develop with a dynamic system that has extreme late binding in all aspects. The first system to really do this in an important way is Lisp. -- Alan Kay