Skip to content

Commit

Permalink
fix ansi filter regex for GNU sed #123
Browse files Browse the repository at this point in the history
Different seds interpret ? and \? differently, both can be a
metacharacter. As in the case of FreeBSD sed and GNU sed respectively.

Use [?] for a literal ?, this is safe on all seds.
  • Loading branch information
rkitover committed Jul 29, 2015
1 parent 8376f35 commit 6969f02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vimpager
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ find_rc() {
}

ansi_filter() {
sed -e 's/\[;*\?*\([0-9.]*\(;[0-9]*\)*\)*[A-Za-z]//g'
sed -e 's/\[;*[?]*\([0-9.]*\(;[0-9]*\)*\)*[A-Za-z]//g'
}

# Normally, filter outputs overstrike free content to STDERR.
Expand Down

0 comments on commit 6969f02

Please sign in to comment.