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*

1
  • \1/p in backquotes won't work at all (I assume you copied/entered that wrong) and s/pattern/\1/p is really a combination of two things: replace the matched data with the first match group, and after completing the substitution print the resulting line. But it won't work here because you didn't specify any match group(s). If you do specify a group like 's/.*\([goodchars]\+.*\)/\1/p' then the command will run but it will select only one char per line not all the 'good' ones. Commented Dec 31, 2017 at 6:38