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*

2
  • 2
    Also awk regexps don't have perl's +? operator. Even if it was supported, it wouldn't make much sense here, the first one would make no difference compared the + and the second is superflous as a non-greedy \n+? followed by nothing is the same as just \n. (using a regexp as RS is also not standard/portable) Commented Nov 25, 2020 at 19:19
  • 1
    See also index() to find substrings. Commented Nov 25, 2020 at 19:20