Answers for "regex check if word is in string"

PHP
2

if word exist in string

$a = 'How are you?';

if (strpos($a, 'are') !== false) {
    echo 'true';
}
Posted by: Guest on April-28-2020
1

Regex not contains

^((?!hede).)*$
Posted by: Guest on November-04-2021
0

regex not contains

^(?!keyword).*\n // Regex pattern to find lines that do not contain keyword, incl newline
Posted by: Guest on January-27-2022

Code answers related to "regex check if word is in string"

Browse Popular Code Answers by Language