Regex not to allow double underscores

后端 未结 3 827
你的背包
你的背包 2021-01-19 01:58

Trying to apply regex for not allowing a string with double underscores

 [a-z][a-z0-9_-]+[^__]

but its failing in many cases like:

3条回答
  •  醉话见心
    2021-01-19 02:26

    in perl it would be:

        if($a =~ /__/){
        } else{
        }
    

    which means if string a contains "__" do something, if not do something else. Of course there is many ways how to beutify such code

提交回复
热议问题