Created
September 10, 2021 08:27
-
-
Save enisozgen/51cb69ef06724c644d07e4ad69a97329 to your computer and use it in GitHub Desktop.
visualize your regular expression easily on your browser
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
#!/bin/sh | |
# https://unix.stackexchange.com/a/152025/457201 | |
# 1 . Usage copy the regular expression which is hard to understand | |
# 2. Run `sh regulex.query.sh` | |
mk_regulex_query() { | |
url_encode() { | |
# http://stackoverflow.com/a/298258/3541063 | |
perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$1" | |
} | |
echo "https://jex.im/regulex/#!flags=&re=`url_encode "$1"`" | |
} | |
SEARCH_TEXT=`/usr/bin/xsel --clipboard` | |
xdg-open `mk_regulex_query "$SEARCH_TEXT"` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment