Parsing the string in PHP -


How can I divide this line:

My [wǒ] - ( Pronoun) I or me [nǐ] - (pronoun) you (second person singular);

My [wǒ] - (pronoun) me or me

你 [nǐ] - (pronoun) you (second person singular);

that [tā] - (pronoun) he or she

we say, insert after each line of tag?

Thank you!

UPD was my bad, duration, but it was a mistake.

The only obvious pattern we can see is that you have removed the dots "A foreign letter, a place And an opening bracket ".

Note to that:

   

Note that using this algorithm, line break lines will be replaced at the beginning. Do not forget the UTF-8 flag, and use UTIF-8 everywhere in your application or processing strings will be a mess.

EDIT: If you ever want two rows at the beginning of the line break, then you can use it for that purpose:

  $ string = " I [wǒ] - (pronoun) me or you [me] [nǐ] - (pronoun) you (second person singular); He himself [tā] - (pronoun) he or she "; // the same pattern, but excluding the first one of "^", where string $ result = preg_replace ('/ (? & Lt;! ^) (. \.) / U', '

; $ 1 ', $ string); $ Return result;

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -