I have a small problem I really can't understand :
bash -c 'if [[ "hello" =~ ^[a-zA-Z0-9]\{1,\}\\.$ ]] ; then echo "OK" ; else echo "KO" ; fi
I think this should give me KO and it gives me OK... I would like to match things with at least 1 character and ending with a dot...
I finally noticed that it works with bash version 4.1.5 and not with version 3.2.25
How should I proceed with this version ?
EDIT :
I found a workaround that works, but I don't know why I had to put the escaped dot between brackets:
bash -c 'if [[ "hello" =~ ^[a-zA-Z0-9]{1,}[\.]$ ]] ; then echo "OK" ; else echo "KO" ; fi'