Regex для поиска фразуC#

Место общения программистов C#
Anonymous
Regex для поиска фразу

Сообщение Anonymous »

Я должен искать фразу в большой строке, может быть длиной 500 или 600 или выше, теперь я должен проверить, существует ли фраза или нет < /p>

phrase = "Lucky Draw"

big string1 = "I'm looking for Lucky Draw a way to loop through the sentences and check"

big string1 = "I'm looking for specialLucky Draw a way to loop through the sentences and check"

big string3 = "I'm looking for Lucky Draws a way to loop through the sentences and check"

bool success = Regex.Match(message, @"\bLucky Draw\b").Success;
< /code>

Я делаю приведенный выше обходной путь, но он не удовлетворяет всем случаям.bool success = Regex.Match(message, **arrayofstrings**).Success;


Подробнее здесь: https://stackoverflow.com/questions/510 ... -searching

Вернуться в «C#»