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.

5
  • Thank you for the link Commented Jan 17, 2020 at 10:25
  • 1
    Escaping a dash in a bracketed expression would not help. Note that backslashes have no special meaning to the expression inside [...]. This also means that [\.] matches a dot or a backslash. Commented Jan 17, 2020 at 11:59
  • Really? I doubt. To match forward slash, you have to escape it twice \\ to match it Commented Jan 17, 2020 at 15:12
  • @JamesJohn Try e.g. grep '[\]' <<<'\', or grep -o '[\.]' <<<'123\.abc' Commented Jan 17, 2020 at 16:01
  • Paste the problem in grep and see the error, then apply my fix to fix it Commented Jan 17, 2020 at 17:44