I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
You list [ STRING =~ PATTERN ] in your single-bracket conditions, but then go on to say it's different in double-bracket conditions. What did you mean?
I think the main benefit of using single-brackets is that those conditions will likely work in other shells, even if they're not as powerful.
You list
[ STRING =~ PATTERN ]
in your single-bracket conditions, but then go on to say it's different in double-bracket conditions. What did you mean?I think the main benefit of using single-brackets is that those conditions will likely work in other shells, even if they're not as powerful.
Nice catch man, thanks.
Updated. That regex should work with double brackets
[[ STRING =~ PATTERN ]]