How true to do a regular expression?

Guys, please tell me how to file this expression:

There is a pattern:
/Pref.* other.*/

Line:
Hello friend

All okay.

What needs to be done in the template below And were derived:

each hi

Thank you.
June 27th 19 at 15:19
1 answer
June 27th 19 at 15:21
Solution
So?)
/(Pref|oth).* (Pref|oth).*/

88b4219375274909aec4750de8a61b01.jpg
Probably will do =) I think there is certainly more koldovskoe solution shorter. But the witch is silent =)
Thank you. - elwyn.Schmidt commented on June 27th 19 at 15:24
: it seems these functions find one occurrence. I have a file with strings. And there you have to find many rows. - elwyn.Schmidt commented on June 27th 19 at 15:27
: I'm afraid, in real conditions, this semi-humorous regular season will not survive.
For example, under a coincidence as the same enters the string "Hello, you're dead, you're not my friend anymore" - Lulu.Reynolds commented on June 27th 19 at 15:30
: well, unless there are conditions. I have a task a lot easier. There is a maximum in the proposal will be no more than 4 sentences. So it fits me. =) - elwyn.Schmidt commented on June 27th 19 at 15:33
: many letters, and my task much easier. Thanks =) - elwyn.Schmidt commented on June 27th 19 at 15:36

Find more questions by tags Regular expressionsPHP