how can I exctract attribute value using JAVA regex

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

I have such string:



        
2条回答
  •  鱼传尺愫
    2021-01-20 17:16

    myString.replaceFirst(myString, "^

    assuming myString contains your string with the a element.

    As the href attributes cannot be nested, this should be fine and no full HTML parser is needed. A restriction is that it will only find href attributes in double quotes.

提交回复
热议问题