On Thu, 8 May 2025 at 15:31, David C Rankin wrote:
> this is a definite change from all prior bash versions
>
I checked the following command across several bash versions:
[[ 38.0.0.0/8 =~ ^([^.]{1,3})[.]([^.]{1,3})[.]([^.]{1,3})[.]([^.]{1,3})$
]]; echo $? ${BASH_REMATCH[@]}
archlinux bash 5.2
Arch devs,
I have a script that parses IP and CIDR notation using the following
to capture IPs:
[[ $1 =~ ^([^.]{1,3})[.]([^.]{1,3})[.]([^.]{1,3})[.]([^.]{1,3})$ ]]
# validate 5 elements in BASH_REMATCH array
if [ "${#BASH_REMATCH[@]}" -eq 5 ]; then
...
(yes, I can improve it -- but that's n