diff --git a/scripts/remove-version-match.sh b/scripts/remove-version-match.sh index 44fcfcf..c6ce03e 100755 --- a/scripts/remove-version-match.sh +++ b/scripts/remove-version-match.sh @@ -3,4 +3,6 @@ if [ -z $1 ]; then echo "Must specify a file to modify..." exit 1 fi -perl -pe 's;^=?(\S+)(?:-[[:digit:]]+\.\S+)(\s)(\S+)$;\1\2\3;' -i "${1}" +regex='^=?(\S+)(?:-[[:digit:]]+\S*)(\s)(\S+)$' +sub='\1\2\3' +perl -pe "s;$regex;$sub;gm" -i "${1}"