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.

2
  • 15
    Note, group capture requires sed to turn on extended regular expressions with the -E flag.
    – peterh
    Commented Jun 17, 2020 at 13:15
  • 8
    Also note, sed -E is for Max OSX and FreeBSD. If you are using a GNU distro (or in Git Bash or WSL), sed -r also works. If you're concerned about cross-platform compatibility, prefer -E.
    – mdhansen
    Commented Aug 3, 2021 at 20:09