Extraction of attribute values from pattern matches
- From: "Peekachu" <skailaje@xxxxxxxxx>
- Date: 7 Jul 2006 16:09:58 -0700
Hi,
My program has to deal with a lot of text of the pattern:
"Name=userLocale", "Value=English", ENDITEM
I need to do two things:
1> Check if the text matches a certain pattern.
2> If there is a pattern match, extract the attribute value parts
('userLocale' and 'English', in the text above) of the text into
Strings or a String array.
The first part is easy to do using the Pattern and Matcher classes. I
am struggling with the second part. It is easy to do it using the
String class methods such as 'split' and 'substring' but I was looking
for a more elegant way to do this, since I need to do this operation in
several places throughout my program.
Thanks,
Peekachu
.
- Follow-Ups:
- Re: Extraction of attribute values from pattern matches
- From: Oliver Wong
- Re: Extraction of attribute values from pattern matches
- Prev by Date: Re: Reflection in JUnit tests
- Next by Date: Re: Reflection in JUnit tests
- Previous by thread: Mobile Phone Application
- Next by thread: Re: Extraction of attribute values from pattern matches
- Index(es):
Relevant Pages
|