Positive Expression ??????????????? Urgent & lt ;? Php & nbsp; $ str = '& lt; divid = & quot; Div3 & quot; class = & quot; modResumeInfo & quot; & gt; & lt; divclass = & quot; title & quot; onclick = & qu positive expression ??????????????? Urgent
$ Str ='
Foreign language proficiency
English: proficient in reading and writing | proficient in listening and speaking
Korean: average read/write capability | excellent listening and speaking capabilities
German: average reading/writing capability | average listening and speaking ability
I want to extract the three English words, Korean and German. how do I use regular expressions?
In this format:
Prefix string (? [\ S \ S] *?) Rear string
------ Solution --------------------
PHP code
$ Str = 'foreign language proficiency in English: proficient in reading and writing | proficient in listening and speaking Korean: average in reading and writing | excellent in listening and speaking German: average in reading and writing | average in listening and speaking
'; Preg_match_all (' @ (. +) :(. +) @ U', $ str, $ match); var_dump ($ match [1]);
------ Solution --------------------
PHP code
$ Str = <TEXT foreign language proficiency: English: proficient in reading and writing | proficient in listening and speaking Korean: average in reading and writing | excellent in listening and speaking German: average in reading and writing | average in listening and speaking
TEXT; preg_match_all ("/(. *):/", $ str, $ arr); print_r ($ arr );