Extraction of attribute values from pattern matches



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

.



Relevant Pages

  • Re: Predicting the Future and Kolmogorov Complexity
    ... Predictability is based on the pattern itself. ... addition to the string. ... For any prediction scheme, there are computable strings that show no ... Out of this hole comes a ~2 cm blue marble followed by a red ...
    (talk.origins)
  • Re: macro for parsing text
    ... SUB will remove from any cell selected the pattern as you described (i.e. ... Dim c As Range ... Dim Temp As String ... Dim colMatches As MatchCollection ...
    (microsoft.public.excel.programming)
  • Re: macro for parsing text
    ... SUB will remove from any cell selected the pattern as you described (i.e. ... Dim c As Range ... Dim Temp As String ... Dim colMatches As MatchCollection ...
    (microsoft.public.excel.programming)
  • Re: string routines and code libraries
    ... Assuming that when you mention "pattern" you are talking ... public static intIndicesOf(string input, ... /// Finds a substring of ain input string between 2 pattern matches ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Entropy in crystalization: up or down?
    ... such a pattern as "artifact" has exactly the same fundamental basis ... for accepting a certain type of narrow band radiosignal as artifact. ... and *that* is the reason that induction on a data string alone is worthless. ... over and over again, in radiosignals. ...
    (talk.origins)