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
  • @Theophrastus If the parentheses weren't escaped would ? apply to the whole expression? Commented Jul 27, 2019 at 17:46
  • 2
    Note that in your second example, [:lower:] is just a regular bracket expression (referring to the set of characters :,l, o etc. (GNU grep at least will guess that you meant [[:lower:]] and warn about that - but not actually treat it as such). Commented Jul 27, 2019 at 17:52
  • @steeldriver you are right I need to enclose that in another [ ]. In that case the * would apply only to [[:lower:]] ? Commented Jul 27, 2019 at 17:54
  • 1
    @Cruise5 yes, AFAIK quantifiers always apply to the immediately preceding regex "atom" only Commented Jul 27, 2019 at 17:59