Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $ uname -a
  2. 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
  3. $ bash --version
  4. GNU bash, version 4.3.33(1)-release (x86_64-apple-darwin14.1.0)
  5. Copyright (C) 2013 Free Software Foundation, Inc.
  6. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  7.  
  8. This is free software; you are free to change and redistribute it.
  9. There is NO WARRANTY, to the extent permitted by law.
  10. $ cat random.sh
  11. str="{templateUrl: '}"
  12. regexp="templateUrl:\s*'"
  13.  
  14. if [[ $str =~ $regexp ]]; then
  15. echo "yes"
  16. else
  17. echo "no"
  18. fi
  19. $ bash random.sh
  20. no
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement