fork(5) download
  1. #!/bin/bash
  2. # your code goes here
  3.  
  4. regex="\\{(\"search_string\"=>\")([a-zA-Z0-9._-]+)(.*?)\\}"
  5. string='{"search_string"=>"NM_001101"}'
  6. echo $regex
  7. if [[ $string =~ $regex ]]
  8. then
  9. echo "OK"
  10. else
  11. echo "not OK"
  12. fi
Success #stdin #stdout 0s 5136KB
stdin
Standard input is empty
stdout
\{("search_string"=>")([a-zA-Z0-9._-]+)(.*?)\}
OK