Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #2850

Re: regex capability

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: regex capability
Date Mon, 04 Apr 2011 19:20:19 +0200
Organization A noiseless patient Spider
Lines 26
Message-ID <incuki$2t2$1@dont-email.me> (permalink)
References <u3sip61i207oesd83ckbrt3vjm66p948kd@4ax.com> <MPidnVkegr4rHQTQnZ2dnUVZ8jydnZ2d@brightview.co.uk>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Mon, 4 Apr 2011 17:20:19 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="QSlUtCeZq+rhbhH2dxxF+A"; logging-data="2978"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+C6fesgXeQURNML5QUZFK"
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
In-Reply-To <MPidnVkegr4rHQTQnZ2dnUVZ8jydnZ2d@brightview.co.uk>
Cancel-Lock sha1:I6TmfWyFZaAmIizJMYswxRRjUHQ=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2850

Show key headers only | View raw


On 04/04/2011 10:26, bugbear allegedly wrote:
> Roedy Green wrote:
>> Consider a string like this:
>>
>> Support DDR2 1066/800/667/533/400 DDR2 SDRAM
>>
>> Is it possible to compose a regex that will peel out those numbers for
>> you each in its own field, or do you have to extract the string
>> "1066/800/667/533/400" and use split?
>>
>> The various things I have tried just grab the last number.
>
> In Java, I use
>
> while(matcher.find()) {
> ...
> }
>
> The key is that Matcher is stateful.

Yup. A regex is what you make of it.

-- 
DF.
An escaped convict once said to me:
"Alcatraz is the place to be"

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

regex capability Roedy Green <see_website@mindprod.com.invalid> - 2011-04-04 00:19 -0700
  Re: regex capability Leif Roar Moldskred <leifm@dimnakorr.com> - 2011-04-04 02:34 -0500
    Re: regex capability Roedy Green <see_website@mindprod.com.invalid> - 2011-04-04 00:50 -0700
      Re: regex capability Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-04-04 08:03 -0400
        Re: regex capability Patricia Shanahan <pats@acm.org> - 2011-04-04 05:25 -0700
        Re: regex capability David Lamb <dalamb@cs.queensu.ca> - 2011-04-04 18:51 -0400
      Re: regex capability Jim Gibson <jimsgibson@gmail.com> - 2011-04-04 17:07 -0700
  Re: regex capability bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-04-04 09:26 +0100
    Re: regex capability Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-04-04 19:20 +0200
    Re: regex capability Robert Klemme <shortcutter@googlemail.com> - 2011-04-04 22:13 +0200
      Re: regex capability markspace <-@.> - 2011-04-04 18:35 -0700
        Re: regex capability bugbear <bugbear@trim_papermule.co.uk_trim> - 2011-04-05 09:09 +0100
        Re: regex capability Paul Cager <paul.cager@googlemail.com> - 2011-04-05 02:10 -0700
          Re: regex capability Patricia Shanahan <pats@acm.org> - 2011-04-05 05:28 -0700
            Re: regex capability Robert Klemme <shortcutter@googlemail.com> - 2011-04-05 06:33 -0700
              Re: regex capability markspace <-@.> - 2011-04-05 10:07 -0700

csiph-web