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*

9
  • In any case *? for non-greedy * is a perl operator. Very few grep implementations support it with -E. Commented Feb 10, 2023 at 11:02
  • Try pcregrep -Mio '(?s)^\h*create .*?;'. Commented Feb 10, 2023 at 11:04
  • @StéphaneChazelas I am not asking for query. I want to understand the behaviour of the queries. Thanks for your suggestion though Commented Feb 10, 2023 at 11:10
  • 1
    I can't reproduce with GNU grep 3.7 Commented Feb 10, 2023 at 11:13
  • This is my grep version grep (BSD grep, GNU compatible) 2.6.0-FreeBSD Commented Feb 10, 2023 at 11:14