您好,欢迎访问一九零五行业门户网

求正则表达式?解决方案

求正则表达式???????????????急
$str = '
外语能力
英语:读写能力精通 | 听说能力熟练
韩语:读写能力一般 | 听说能力良好
德语:读写能力一般 | 听说能力一般
我想取出英语 韩语 德语这三个词,用正则表达是怎么写?
用这种格式:
前字符串(?[\s\s]*?)后字符串
------解决方案--------------------
php code$str = '
外语能力
英语:读写能力精通 | 听说能力熟练
韩语:读写能力一般 | 听说能力良好
德语:读写能力一般 | 听说能力一般
';preg_match_all('@(.+):(.+)
@u',$str,$match);var_dump($match[1]);
------解决方案--------------------

php code$str=
外语能力
英语:读写能力精通 | 听说能力熟练
韩语:读写能力一般 | 听说能力良好
德语:读写能力一般 | 听说能力一般
text;preg_match_all(/(.*):/,$str,$arr);print_r($arr);

其它类似信息

推荐信息