RegEx to get text within tags

后端 未结 5 1709
南旧
南旧 2021-02-06 18:51

I need a Regular Expressions to get the text within 2 tags.

Lets say I want an array returned containing any text within > and

5条回答
  •  温柔的废话
    2021-02-06 19:40

    I believe real problems will arise when you want to parse nesting constructs. For example, when you want to examine XML like this 123456 to extract data included in outermost tags one RegEx alone would not be enough. Just warn you to not use RegEx where some more (powerful and specific) methods exist. Real XML parsers should be considered when doing more complex tasks on XML. My 2 cents...

提交回复
热议问题