Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 15
    "any sufficiently advanced regex is indistinguishable from magic" ;)
    – Alex
    Commented May 31, 2011 at 12:24
  • Note: \s will also match tab and newline, so if you think they can occur in values change [\w\s] to [\w ]
    – Episodex
    Commented May 31, 2011 at 12:28
  • Note - "test:testvalue test2:test:withcolon value test3:testvalue3" fails test2. Commented May 31, 2011 at 13:27
  • @Wonko the Sane: you're right. I added solution to this. Still not perfect though.
    – Episodex
    Commented May 31, 2011 at 13:45
  • Right - the problem is that to use a parser on a pattern, the pattern must always be predictable. Commented May 31, 2011 at 14:49