Answer the question
In order to leave comments, you need to log in
How to implement search for a string in a string with different endings in PHP?
Good afternoon!
Please, tell me how to implement the search for one string in another using PHP5? Moreover, the endings of the words are different. The order must be maintained. The register is independent. Only Russian language.
Example:
You want to extract the string "City incinerator " from the string "City incinerator recycling facility " .
Answer the question
In order to leave comments, you need to log in
stumper.ru - for complex searches (if necessary)
And for simple ones, like this one - simple code .
sphinx, and if the task is quite simple, you can handle it rustically with a stemmer, or take phpMorphy (but it’s very sad)
Well, it’s better to look in the direction of morph libraries, not to write a regular expression for each phraseМусоросжигательн(ый)?.*?\sзавод.*?\sгорода
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question