how can I exctract attribute value using JAVA regex

前端 未结 2 1577
长情又很酷
长情又很酷 2021-01-20 16:36

I have such string:



        
2条回答
  •  逝去的感伤
    2021-01-20 17:31

    For this particular string you can try something like

    Pattern pattern = Pattern.compile("

    but if your string can change (like href atrubute can have other atributes before it) it can not work as expected. That is one of the reasons to use parsers rather then regex.

提交回复
热议问题