realbasic-nug
[Top] [All Lists]

Re: RegEx searching

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: RegEx searching
From: Mark Nutter <manutter51 at yahoo dot com>
Date: Fri, 29 Dec 2006 15:27:36 -0800 (PST)
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=VJJizEb781d2X8R07NU4RQo9J5V7CbldLtA+mf6eJ0QF+xrtRE+WRg6FCAR5LCreKAaEogzhsVw5tcwduWTq9iBlG9DHsv0L7eW63j1JUvOW0y7XPz9kgojieAV+uvIZMbKjjQcZdYX+ercZkwLacFhxD4TazPzx914EqeMmiME=;
--- Peter Karlsson <lists at redpro dot se> wrote:

> Hi,
> Is there a way to get RegEx to give the character position of a
>  
> result as instr do? I've played with SubExpressionStartB but it
> only  
> gives byte positions and that's not enough to select a word in
> an  
> editfield if there's umlauts.

There's a feature request for this:

http://www.realsoftware.com/feedback/viewreport.php?reportid=ayizdwed


> question 2:
> is
> rx.SearchPattern = "(\W)" + search + "(\W)"
> the best pattern to find a word?

Depends on what you mean by "best".  Not to be flippant, but the
RegEx engine has its own idea of what a "word" is, which may not
match your idea.  For general purposes, the \b wildcard works
well as a word boundary marker, since it also matches beginning
or end of line as a word boundary, which \W won't.


Mark Nutter

Quick and easy regex creation and debugging!
http://www.bucktailsoftware.com/products/regexplorer/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>