Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!news.mixmin.net!aioe.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Question Using Regexpi
Date: Wed, 03 Jul 2013 12:52:25 -0500
Organization: Aioe.org NNTP Server
Lines: 28
Message-ID: <kr1ocm$rln$1@speranza.aioe.org>
References: <kr1d2k$3k$1@newscl01ah.mathworks.com> <kr1g6l$3op$1@speranza.aioe.org> <kr1ime$b3c$1@speranza.aioe.org> <see-B53CEB.13200703072013@news.eternal-september.org>
NNTP-Posting-Host: 6z92ouJs6jUrQzBaNtLMgA.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20
X-Notice: Filtered by postfilter v. 0.8.2
Xref: news.mathworks.com comp.soft-sys.matlab:798740

On 7/3/2013 12:20 PM, Doug Schwarz wrote:
...

> Your idea is sound, but you have the RE wrong.  The beginning of a word
> anchor is '\<', not'<\'.  Also, to match 1 or more contiguous digits
> use '\d+'.  So the final expression is '\<\d+\>' which does what you
> want.
>

Thanks, Doug...I stared at and even thought I pasted from the regexp doc 
the form and still couldn't see had the \< reversed.  I wasn't aware of 
(and didn't see in looking thru the voluminous doc altho I'm sure it's 
there if know where to look) the '+' though--would have thought the word 
expression would be sufficient.

 >> regexp(String,'\<\d+\>','match')
ans =
     '61'
 >>

And, by golly! it does...  :)  Now just how easy was that!  :)

I've never had the patience nor enough occasion where was forced to 
learn the syntax well enough that it isn't always starting over from 
near absolute zero every time it might be useful... :)  (or :( more 
appropriately, maybe...)

--