Need help matching a mattern using grep/egrep in bash scripting

后端 未结 3 1367
面向向阳花
面向向阳花 2021-01-22 21:58

I am trying to match all characters of given string but those characters should match in the order as given to the bash script.

while [[ $# -gt 0 ]]; do
  case $         


        
3条回答
  •  没有蜡笔的小新
    2021-01-22 22:20

    Your regex is matching 'a' or 'e' or 'i' because they are in a character set ([]). I think the regular expression you are looking for is

    a+.*e+.*i+.*
    

    which matches 'a' one or more times, then anything, then 'e' one or more times, then anything, then 'i' one or more times.

提交回复
热议问题