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
  • 1
    [^ ] is just one non-blank, you need [^ ]+ to match one or more. Commented Feb 12, 2023 at 20:23
  • Yes, thanks, messed it up in the 1st command. Commented Feb 12, 2023 at 21:32
  • 1
    Note that [\t ] might match a backslash, t, or space, depending on the system's regular expression library (FreeBSD, Ubuntu, Alpine Linux, and OpenBSD would do this). If you want to match a space or a tab, either use a literal tab character instead of \t, or use something like [[:blank:]] which matches a space or tab character in the C or POSIX locales. Commented Feb 12, 2023 at 22:24
  • Thanks @Kusalananda, I corrected my example to explicitly use the -P switch (perl style regex). Commented Feb 13, 2023 at 17:50