I have a regex:
^(\d+\.)?(\d+\.)?(\*|\d+)-SNAPSHOT$
This matches 1.30.0-SNAPSHOT
using regexr:
I now tried to check this in bash:
#!/bin/bash
REGEX="^(\d+\.)?(\d+\.)?(\*|\d+)-SNAPSHOT$"
VERSION="1.30.O-SNAPSHOT"
if [[ $VERSION =~ $REGEX ]]
then
echo "yes"
else
echo "not"
This prints not