Thread: Grouping XML

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2017
    Posts
    3
    Rep Power
    0

    Grouping XML


    Structure of my XML looks like:

    Code:
     
    <Balance>
        <Date>2017-01-01</Date>   
        <POS>
          <No>1</No>
          <Name>ABC</Name>
        </POS>
        <POS>
          <No>1</No>
          <Name>ABC</Name>
        </POS>
        <Author>Joe Deer</Author>
    </Balance>

    I need to write a regular expression for <POS> section. Each section must be a separate group.
  2. #2
  3. Forgotten Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,187
    Rep Power
    9644
    What have you tried and what happened with it?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2017
    Posts
    3
    Rep Power
    0
    Originally Posted by requinix
    What have you tried and what happened with it?

    I did just that https://regex101.com/r/RAA96V/1

    But I would like each <POS> have as a separate group.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2017
    Posts
    3
    Rep Power
    0
    Problem solved.
    Solution:

    <POS>[\w\W]*?<\/POS>

IMN logo majestic logo threadwatch logo seochat tools logo