Ben bu ifade ayıklamak niyetinde ne bir tanıtıcı almak gibi olamaz:
preg_match("/^(?:[\s\*]*?@([^\*\/]+?)\s(.+))/",$line,$match);
$match bir dizi ise $line, bir metin dosyasından bir çizgidir
İşte bir açıklama:
^ # match the beginning of the input
(?: # start non-capture group 1
[\s*]*? # match any character from the set {'0x09'..'0x0D', '0x20', '*'} and repeat it zero or more times, reluctantly
@ # match the character '@'
( # start capture group 1
[^*/]+? # match any character from the set {'0x00'..')', '+'..'.', '0'..'ÿ'} and repeat it one or more times, reluctantly
) # end capture group 1
\s # match a whitespace character: [ \t\n\x0B\f\r]
( # start capture group 2
.+ # match any character except line breaks and repeat it one or more times
) # end capture group 2
) # end capture group 1
* * *@abc asd
: regex maç olacağını bir örnek dize bu
Edit:
Yukarıdaki açıklama oluşturmak için kullanılan çözümleyici bir beta sürümünü yayımladı ettik. Burada indirebilirsiniz: http://big-o.nl/apps/pcreparser/pcre/PCREParser.html