Regex to match multiple strings

前端 未结 6 1941
执念已碎
执念已碎 2020-12-03 14:08

I need to create a regex that can match multiple strings. For example, I want to find all the instances of \"good\" or \"great\". I found some examples, but what I came up w

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 14:59

    I think you are asking for smth you dont really mean if you want to search for any Part of the word, you litterally searching letters

    e.g. Search {Jack, Jim} in "John and Shelly are cool"

    is searching all letters in the names {J,a,c,k,i,m}

    *J*ohn *a*nd Shelly *a*re

    and for that you don't need REG-EX :)

    in my opinion, A Suffix Tree can help you with that

    http://en.wikipedia.org/wiki/Suffix_tree#Functionality

    enjoy.

提交回复
热议问题