search

Home  >  Q&A  >  body text

java - How to grab the content of a specific tag

For example, if I want to capture the content in the following tags, it is just "Catch me"

<p class="c-info-box">抓我</p>

Try the following regular expression

<p class=\"c-info-box\">(.*)</p>

is not feasible. Is there any more suitable expression?

巴扎黑巴扎黑2758 days ago500

reply all(2)I'll reply

  • 世界只因有你

    世界只因有你2017-05-17 10:02:17

    <p class=\"c-info-box\">(.*?)</p>

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-17 10:02:17

    This can be done using css class selection + DOM operation. If you use regular expressions, you will take the long way around

    reply
    0
  • Cancelreply