fork(20) download
  1. #!/bin/bash
  2. haystack="foo 1,bar"
  3. needle='(,|^)foo(,|$)'
  4. if [[ "$haystack" =~ $needle ]]; then
  5. echo 'exists'
  6. else
  7. echo 'does not exist'
  8. fi
Success #stdin #stdout 0s 19656KB
stdin
Standard input is empty
stdout
does not exist