How to find words containing a certain letter with Regular Expressions?

前端 未结 2 1203
耶瑟儿~
耶瑟儿~ 2020-12-20 13:44

I need a regular expression to find any words containing the letter \"y\".

This was my idea:

/\\bw*[y]\\w*\\b/

a word boundary, som

2条回答
  •  难免孤独
    2020-12-20 14:26

    maybe try this:

    [a-zA-Z]*y[a-zA-Z]*
    

    This finds all words that have the letter 'y'.

    I hope I helped. I tested it on http://regexpal.com/

提交回复
热议问题