I am using bash 4.1.10(4)-release and I trying to use a regex to match against two capital letters [A-Z]{2} and then anything. So for example BXCustomerAddress, CAmaterial would be acceptable, but WarehouseMessage would not. I have the following script for testing purposes:
#!/bin/bash
if [[ "Ce" =~ [A-Z]{2} ]]; then
echo "match"
fi
My questions are:
- When I run this script, why does it return that I have a match?
- Does anyone know how I could achieve my desired results?
[A-Z]{2}.*.bash_profileor.bashrcifnocasematchornocaseglobis enabled there.