且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Bash case语句中的正则表达式

更新时间:2023-02-17 23:40:53

Bash大小写不使用正则表达式,但是

Bash case does not use regular expressions, but shell pattern matching only.

因此,应该使用模式ws*.host.com(或ws-+([0-9]).host.com)代替正则表达式ws-[0-9]+\.host\.com,但这看起来有点高级,我从没尝试过:-)

Therefore, instead of regex ws-[0-9]+\.host\.com you should use pattern ws*.host.com (or ws-+([0-9]).host.com, but that looks a bit advanced and I've never tried that :-)