It seems that regular expressions need to be learned. Today, we have encountered a problem of intercepting strings. There is a string in the following format: var vcard = '<vCard xmlns = "vcard-temp"> <N> <GIVEN> 1 </GIVEN> </N> <BDAY> 2 </BDAY> <EMAIL> 3 </EMAIL> <URL> 4 </URL> <ADR> <CTRY> 5 </CTRY> <REGION> 6 </REGION> <LOCALITY> 7 </LOCALITY> <STREET> 8 </STREET> <EXTADD> 9 </EXTADD> <PCODE> 10 </PCODE> </ADR> <ORG> <ORGNAME> 11 </ORGNAME> <ORGUNIT> xxxxxxxxxxxxx </ORGUNIT> </ORG> <TITLE> 12 </TITLE> <ROLE> 13 </ROLE> <DESC> 14 </DESC> </vCard>'; the solution for the value in the required <ORGUNIT> xxxxxxxxxxxxx </ORGUNIT> is as follows: [jav Asday] var vcard = '<vCard xmlns = "vcard-temp"> <N> <GIVEN> 1 </GIVEN> </N> <BDAY> 2 </BDAY> <EMAIL> 3 </EMAIL> <URL> 4 </URL> <ADR> <CTRY> 5 </CTRY> <REGION> 6 </REGION> <LOCALITY> 7 </ LOCALITY> <STREET> 8 </STREET> <EXTADD> 9 </EXTADD> <PCODE> 10 </PCODE> </ADR> <ORG> <ORGNAME> 11 </ORGNAME> <ORGUNIT> xxxxxxxxxxxxx </ORGUNIT> </ORG> <TITLE> 12 </TITLE> <ROLE> 13 </ROLE> <DESC> 14 </DESC> </vCard> '; var t, reg =/<ORGUNIT> ([\ s \ S] *?) <\/ORGUNIT>/ig; while((t‑reg.exe c (vcard ))! = Null) {alert (t [1]);} dml@2013.1.7