Regexp match all

Hi,

I’ve got this little text:

RRULE: FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
UID: MDJSETLIJ3535J0DG9JSDG09
SUMMARY: Test
RRULE: FREQ=WEEKLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
UID: SOI50935OP35IJLISD9T
SUMMARY: Test2

How can I extract all data in this form?

[
  {
    "rrule": "FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10",
    "uid": "MDJSETLIJ3535J0DG9JSDG09",
    "summary": "Test"
  },
  {
    "rrule": "FREQ=WEEKLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10",
    "uid": "SOI50935OP35IJLISD9T",
    "summary": "Test2"
  }
]

What’s the best way to do this? I cannot find a “regexp match all” function somewhere :face_with_monocle:

Thanks a lot!
Cadish

Hi @Cadish, you mean you want to have everything from your rrule field in separate fields? Seeing your data seems to be formatted nicely by using the semicolon ; as a field separator and = as the key/value separator I reckon the JavaScript .split() method is your best bet here.

For example like so:

This would move each of the values in your rrule field into its own field like so:

Hope this helps!

Thanks, but my input is

RRULE: FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
UID: MDJSETLIJ3535J0DG9JSDG09
SUMMARY: Test
RRULE: FREQ=WEEKLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
UID: SOI50935OP35IJLISD9T
SUMMARY: Test2

So, not really structured as in your example. Really cannot find an elegant way to do this.

Thanks a lot for your help! Very much appreciated!!!
Cadish

Hi @Cadish, can you please share the exact JSON data you are currently seeing in n8n and which you need to format? Thank you!