fork download
  1. #!/bin/bash
  2. tmp="A123-B1234";
  3. if [[ $tmp =~ ^A[0-9]{3}-B[0-9]{4}$ ]];then
  4. msg="valid";
  5. else
  6. msg="invalid";
  7. fi
  8.  
  9. echo $msg;
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
valid