0

Possible Duplicate:
RegEx match open tags except XHTML self-contained tags

I need get value from input where name = variable

    ....
    <input type='hidden' name='variable1' value='2d331be47563423424abdb7fe2eee6401c7b00417' />
<input type='hidden' value='2d331be47563423424abdb7fe2eee6401c7b00417' name='variable2'  />
<input value='2d331be47563423424abdb7fe2eee6401c7b00417' type='hidden' name='variable3'  />
    ....
Community
  • 1
  • 1
Mediator
  • 14,387
  • 34
  • 108
  • 180
  • 10
    http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 – Paul Tomblin Nov 17 '10 at 18:01
  • There are a bunch of good XML parsers for Java. Use one of those. – Paul Tomblin Nov 17 '10 at 18:02
  • @Paul Tomblin: HTML is not XML. But there are probably also a bunch of good HTML parsers for Java. – Gumbo Nov 17 '10 at 18:07
  • your next question would likely be "Which HTML parser should I use?", I would then suggest Jsoup: http://stackoverflow.com/questions/3152138/what-are-the-pros-and-cons-of-the-leading-java-html-parsers It's then as simple as `Elements inputs = document.select("input[name^=variable]");`. – BalusC Nov 17 '10 at 18:27

0 Answers0