RegEx to Parse SharePoint Multi-Value XML Result -


good day, fellow so'ers,

i'm using my favorite regex tool parse string:

5;#.net;#26;#asp.net;#1;#sharepoint;#3;#windows server;#20;#db2 

i'm using powershell query sharepoint web services via caml i'm parsing returned xml meaningful psobject run business logic.

i going .split() on ;# did not result. note: may reconsider later answer more proper regex this...

the string result consistent, in format every time, starting number , ending no semi-colon ;.

i want extract id , value. if it's not obvious, id being integer , value being string between # , ;.

my regex reflexes aren't quite batman-level yet, , particular string challenge me. want produce clean result consisting of id , value capture groups...

online demo

i think expression should work: /(\d+)(?:[;][#])([\w.]+)/g


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -