Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #28856
| From | Knute Johnson <eternal@knutejohnson.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Regex? |
| Date | 2014-06-25 18:10 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <lofrui$n84$1@dont-email.me> (permalink) |
| References | (2 earlier) <c0i5vfFqriiU1@mid.individual.net> <lo1im5$3ak$1@dont-email.me> <lo1j4g$6l6$1@dont-email.me> <lo2dji$k7u$1@dont-email.me> <3rplq9hoa7vg9b7oq6iqh4e5iesatvg1f5@4ax.com> |
On 6/25/2014 08:15, Roedy Green wrote:
> On Fri, 20 Jun 2014 15:46:13 -0700, Knute Johnson
> <eternal@knutejohnson.com> wrote, quoted or indirectly quoted someone
> who said :
>
>> Well I've been round and round on this, I thought originally that I
>> could find all the examples of the search string with one call to
>> Matcher.matches() but I can't figure out how to do that
>
> I have examples of use of all the regex methods in little SSCCEs.
>
> See http://mindprod.com/jgloss/regex.html
>
Thanks I'll take a look.
I think what I thought I could do is not possible. Apparently you can't
get multiple capture groups without multiple sets of parenthesis. I
thought I could do something like;
Pattern.compile("(the)*") and capture all of the 'the's in the string in
their own group. But as it turns out each group must have its own set
of parenthesis.
So instead of that approach I decided to use Matcher.find() to search
through the string and keep a list of the matches.
I'll post some code once I've got it cleaned up and debugged.
--
Knute Johnson
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Regex? Knute Johnson <eternal@knutejohnson.com> - 2014-06-19 21:39 -0700
Re: Regex? Knute Johnson <eternal@knutejohnson.com> - 2014-06-19 22:03 -0700
Re: Regex? Robert Klemme <shortcutter@googlemail.com> - 2014-06-20 09:25 +0200
Re: Regex? Knute Johnson <eternal@knutejohnson.com> - 2014-06-20 08:06 -0700
Re: Regex? Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-06-20 11:14 -0400
Re: Regex? Knute Johnson <eternal@knutejohnson.com> - 2014-06-20 15:46 -0700
Re: Regex? Roedy Green <see_website@mindprod.com.invalid> - 2014-06-25 08:15 -0700
Re: Regex? Knute Johnson <eternal@knutejohnson.com> - 2014-06-25 18:10 -0700
Re: Regex? Knute Johnson <eternal@knutejohnson.com> - 2014-06-30 09:52 -0700
Re: Regex? Roedy Green <see_website@mindprod.com.invalid> - 2014-06-21 09:49 -0700
Re: Regex? Roedy Green <see_website@mindprod.com.invalid> - 2014-08-01 02:45 -0700
csiph-web