Find all words with 3 letters with regex

前端 未结 3 1131
有刺的猬
有刺的猬 2020-12-05 21:35

I\'m trying to find all words with 3 letters in a string.
So in this list

cat monkey dog mouse

I only want

cat dog
         


        
3条回答
  •  悲&欢浪女
    2020-12-05 22:19

    you can use . instead of [a-zA-Z] if you want to match any character (also numbers):

     \b.{3}\b
    

提交回复
热议问题