List Info

Thread: Re: Getting sub value from match




Re: Getting sub value from match
country flaguser name
United States
2007-09-17 04:16:39
You need to put into () the groups that you wish to
capture:
<idssequence="1">(d)</id>

or maybe:
<idssequence="1">(d\)</id>


I recommend you to read this tutorial for regular
expressions in Java
(even if you are not using java, regex are quite standard)
http://java.sun.com/docs/books/tutorial/essent
ial/regex/intro.html

HTH,
DAvid

On Sep 15, 12:47 am, Kevin <KevinRTho...gmail.com> wrote:
> Hi,
>
> If I have this regular expression:
>
> <idssequence="1">d</id>
>
> which in a given block of text, would return me this:
>
> <id sequence="1">38839680</id>
>
> But what I want is the number that is in that returned
value.  Is
> there a way to modify the orininal expression so that
it just returns
> the number?  I don't mean just look for numbers,
because I only want
> the number if it exist in that larger match.  So I want
to first match
> this: <id
sequence="1">38839680</id> and then have
the number parsed
> out of that.  But the key is I need one regular
expression to do
> this.  Is that possible?
>
> Thanks,
>
> Kevin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )