Regular expression that includes all keyboard characters except '~' and ','

前端 未结 6 1176
余生分开走
余生分开走 2021-02-19 20:03

How do I write a regular expression that includes all keyboard characters except \'~\' and \',\'?

6条回答
  •  死守一世寂寞
    2021-02-19 20:59

    Reg-Ex for all supported key board chars worked for me :

    /^[a-zA-Z0-9.!@?#"$%&:';()*\+,\/;\-=[\\\]\^_{|}<>~` ]+$/
    

    To except '~' and ',' chars :

    /^[a-zA-Z0-9.!@?#"$%&:';()*\+\/;\-=[\\\]\^_{|}<>` ]+$/
    

提交回复
热议问题