Hiçbir boş satır ve varsa tek tek eşleştirerek eğer preg_match_all bütün dize eşleştirme

0 Cevap php

Hey, So in php I want preg_match_all to return:

Array ( [0] => text1
[1] => text2
) 

girişi ise:

(text1)

(text2)

ve geri dönmek için:

Array ( [0] => 
this is some text
and (bla bla)
 ) 

durumda girdidir:

(this is some text
and (bla bla)
)

) ayrı ayrı uyumlu olmalı ve yeni bir satır yoksa bütün dize bir dize olarak tedavi edilmelidir (arasında () ve yeni bir çizgi olduğunu aka varsa

bu yüzden ilk örnekte bu işleri

preg_match_all('/\((.*)\)/', $match, $matches);

ve İkinci örnekte bu çalışır:

 preg_match_all('/\((.*)\)/s', $match, $matches);

by adding the s modifier but I'm not able to write a regular expression that match the two cases in the way I want

herhangi bir yardım çok takdir

0 Cevap