fork(12) download
  1. #!/bin/bash
  2. test="123456-name-goes-here.1.2.3-something.zip"
  3. reg="[0-9]\.[0-9](\.[0-9])?(\.[0-9])?(-[a-z-]*)?"
  4. if [[ $test =~ $reg ]]; then
  5. echo ${BASH_REMATCH[0]};
  6. fi
Success #stdin #stdout 0s 5100KB
stdin
Standard input is empty
stdout
1.2.3-something