CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: Capturing Groups using Regex

  1. #1
    Join Date
    Jan 2019

    Capturing Groups using Regex

    I am trying to capture groups in JAVA using Pattern Matcher,

    This is how the data looks like, multiple code-value pairs, all are optional

    I have created a regex expression like this

    The groups are not being captured as it required as everything is captured in the first group
    This is the output string I am generating, concatenating all the groups with pipe delimited.


    Can someone please help to figure out the issue in the regex to capture into different groups...

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004

    Re: Capturing Groups using Regex

    Must you use RegEx? Could you use split string instead and read the result into string array where the even number indexes are the keys and the odd number indexes are the values?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)