Skip to content

Commit

Permalink
Escape pipes in search regex
Browse files Browse the repository at this point in the history
Fix #7
  • Loading branch information
molovo committed Feb 20, 2017
1 parent 5d9ce71 commit 99e82df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tipz.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function _tipz_find_match() {
# Create a regex that finds an exact match for
# the current argument string
args="${(@)args[@]}"
local pattern=$'^[\'\"]?'${args//([\{\}\(\)\[\]\*\?\:\\\.])/\\$1}$'[\'\"]?$'
local pattern=$'^[\'\"]?'${args//([\{\}\(\)\[\]\*\?\:\\\.\|])/\\$1}$'[\'\"]?$'

# Check if the command matches the regex
if [[ "$command" =~ $pattern ]]; then
Expand Down

0 comments on commit 99e82df

Please sign in to comment.