我使用以下shell脚本来检查正则表达式.
#!/bin/bash urlPattern='/demo/([^\s]+)/' #echo $urlPattern if [[ "/demo/akash/" =~ $urlPattern ]];then echo "match" else echo "not match" fi
给我一个"不匹配"的结果
unix bash shell
bash ×1
shell ×1
unix ×1