Good afternoon, tell me how to get a paragraph that is between line breaks contains one sentence ending in characters. ? !

For example, there is a text:

"1)Airbus Industrie began as a consortium of European aviation firms 

to compete with American companies such as Boeing, McDonnell Douglas, and Lockheed. While many European aircraft were innovative, even the most successful had small production runs.

 2)In 1991, Jean Pierson, then CEO and Managing Director of Airbus 

Industrie, described the number of factors that caused the American aircraft manufacturers.

 3)The land mass of the United States made air transport the favoured 

mode of travel; a 1942 Anglo-American agreement entrusted transport aircraft production to the US; World War II had a profitable, vigorous, powerful and structured aeronautical industry.

 4)The retention of production and engineering assets by the partner 

companies in effect made by Airbus Industrie a sales and marketing company. This arrangement led to the fact that the four partner companies faced.

 5)BAE Systems and EADS transferred their production assets to the new 

company, Airbus SAS, in return for shareholdings in that company. "

Consider for example the second paragraph and fourth. In the fourth two sentences, it means not suitable. In the second one, that is necessary.

Get a paragraph turned out:

 preg_match_all("/^[\r\n](.*)[\r\n]/m", $text, $content); 

But how to single out one sentence and find out that it did not find one solution, tried

 (.*|\.|\?|\!) 

but there is no result.

  • and the third? ; Is it considered the end of a sentence? and with 5m it is not clear - zb '
  • So what? preg_match_all ("/^(.*)(?<=[.?![$$ m", $ text, $ content); - ReinRaus
  • Sorry the third one didn’t see there instead; must be points - brotheryura
  • A fifth does not have at the end of the transition to a new line - brotheryura
  • Thank you ReinRaus! I understand the meaning of the cracking of something already ;-) Thanks again ;-) - brotheryura

1 answer 1

Reply from comments

 preg_match_all("/^(.*)(?<=[.?!])$/m", $text, $content);