forked from WW-Digital/reactive-kinesis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
34 lines (24 loc) · 904 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if [[ "v1.2.3-SNAPSHOT" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-M[0-9]+)?$ ]]; then
echo "** Matched v1.2.3-SNAPSHOT **"
else
echo "Didn't match v1.2.3-SNAPSHOT"; fi
if [[ "v1.2.3" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-M[0-9]+)?$ ]]; then
echo "** Matched v1.2.3 **"
else
echo "Didn't match v1.2.3"; fi
if [[ "1.2.3" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-M[0-9]+)?$ ]]; then
echo "** Matched 1.2.3 **"
else
echo "Didn't match 1.2.3"; fi
if [[ "v1.2.3-M1" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-M[0-9]+)?$ ]]; then
echo "** Matched v1.2.3-M1 **"
else
echo "Didn't match v1.2.3-M1"; fi
if [[ "v1.2.3-M1-SNAPSHOT" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-M[0-9]+)?$ ]]; then
echo "** Matched v1.2.3-M1-SNAPSHOT **"
else
echo "Didn't match v1.2.3-M1-SNAPSHOT"; fi
if [[ "v1.2.3-X1" =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?(-M[0-9]+)?$ ]]; then
echo "** Matched v1.2.3-X1 **"
else
echo "Didn't match v1.2.3-X1"; fi