Skip to main content
Question

Regex to Grab Key:Value

  • March 11, 2025
  • 2 replies
  • 28 views

Not a question but rather something useful. I have data that is in key:value format, using key=value in the extract format did not work. I was able to extract every key and value with this one regex extract.

(?<_NAME_0>.*):\s(?<_VALUE_0>.*)

2 replies

Jon Rust
Forum|alt.badge.img
  • Employee
  • March 11, 2025

Upgoat! Great find, and thanks for sharing. That trick comes in handy so often. Also, dont forget to hit the global flag on the regex to get more than one matching pair.


  • Participating Frequently
  • March 11, 2025

hey @ekalby , this is a great tip–in the future, go ahead and ask your question and then post a separate answer if you have it, that way we can mark it solved and you can get the cribloons for it!