Regex match entire words only

后端 未结 7 1308
挽巷
挽巷 2020-11-21 05:35

I have a regex expression that I\'m using to find all the words in a given block of content, case insensitive, that are contained in a glossary stored in a database. Here\'s

7条回答
  •  醉话见心
    2020-11-21 06:08

    For Those who want to validate an Enum in their code you can following the guide

    In Regex World you can use ^ for starting a string and $ to end it. Using them in combination with | could be what you want :

    ^(Male)$|^(Female)$

    It will return true only for Male or Female case.

提交回复
热议问题