To ask for a regular expression???????????????? Tokyu
$str = '
Foreign Language proficiency
English: Literacy Proficiency | Proficient in listening and speaking skills
Korean: Reading and writing Ability General | Good listening and speaking ability
German: Reading and writing Ability General | Listening and speaking ability general
I want to take out three words in English, Korean and German, how to write with regular expression?
In this format:
The previous string (? [\s\s]*?] Post-string
------Solution--------------------
PHP Code
$str = 'Foreign Language proficiency
English: Literacy Proficiency | Listening and speaking proficiency in Korean: reading and writing Ability General | Good listening and speaking skills German: Reading and writing Ability General | Hearing ability generally
';p reg_match_all (' @ (. +): (. +) @u ', $str, $match); Var_dump ($match [1]);
------Solution--------------------
PHP Code
$str =<<< TEXTForeign Language proficiency
English: Literacy Proficiency | Listening and speaking proficiency in Korean: reading and writing Ability General | Good listening and speaking skills German: Reading and writing Ability General | Hearing Ability General
Text;preg_match_all ("/(. *):/", $str, $arr);p Rint_r ($arr);