Last active
June 28, 2016 03:47
-
-
Save thiagomata/bd2d06e195a4b9bbec1078cb7770da8b to your computer and use it in GitHub Desktop.
Replace Accents Characters to Ascii in Regex Variable using Sed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo '{"doNotReplaceKey":"bábögêjírù","replaceValueKey":"bábögêjírù"}' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[áâàãä]/replaceValueKey":"\1a/g;ta' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[éêèë]/replaceValueKey":"\1e/g;ta' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[íîìï]/replaceValueKey":"\1i/g;ta' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[óôòõö]/replaceValueKey":"\1o/g;ta' \ | |
| sed -e ':a;s/replaceValueKey":"\(.*\)[úûùü]/replaceValueKey":"\1u/g;ta' | |
# result: | |
# {"doNotReplaceKey":"bábögêjírù","replaceValueKey":"babogejiru"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment