Skip to main content

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.

Required fields*

4
  • 19
    for those who do not need grep: perl -lne 'print $1 if /foobar (\w+)/' < test.txt Commented Dec 19, 2016 at 11:56
  • How come you need to escape the parentheses and + ? Commented Jan 29, 2020 at 9:14
  • 3
    To indicate a regex grouping and to match 1 or more characters instead of searching for the actual characters (, ), and +. Commented Jan 29, 2020 at 15:54
  • 1
    @Sébastien You need \(, \), \+ in GRE. Use ERE = egrep, when you like (, ), + Commented Oct 14, 2022 at 15:44