I
I
I752015-11-15 20:06:18
PHP
I75, 2015-11-15 20:06:18

How to choose a word that is between two known words?

For example, it is common for each of us not to love someone to choose a word between us and not, i.e. the word is peculiar

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2015-11-15
@I75

$str = 'каждому из нас свойственно не любить кого-нибудь';

if (preg_match('/\bнас\b\W*([\w-]+)\W*\bне\b/iu', $str, $match)) {
    $word = $match[1];
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question