Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ uname -a
- Darwin MacBook-Air 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
- $ bash --version
- GNU bash, version 4.3.33(1)-release (x86_64-apple-darwin14.1.0)
- Copyright (C) 2013 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
- This is free software; you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law.
- $ cat random.sh
- str="{templateUrl: '}"
- regexp="templateUrl:\s*'"
- if [[ $str =~ $regexp ]]; then
- echo "yes"
- else
- echo "no"
- fi
- $ bash random.sh
- no
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement