Situation
Give yourself a HTML page where you will find a form containing two text boxes, one for the name and one for the email. Then there was the need, to do some tests on Android, to get only a snippet of the code and play in a list, but I tried in some ways to create a regular expression to retrieve that code part but I did not succeed. The org.apache.http.legacy
library is used to obtain source code where no barrier was found in reading the following code.
Code
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
<label for="nome">Nome</label>
<input type="text" name="nome" id="nome"/><br><br>
<label for="email">email</label>
<input type="text" name="email" id="email"/><br><br>
<input type="submit" value="Enviar">
</form>
</body>
</html>
Doubt
I would like to use the regex to identify exactly the beginning and end of each input
, being <input
and />
, so for this HTML would result for example in two items:
<input type="text" name="nome" id="male"/>
<input type="text" name="nome" id="male"/>
After the ID, I want to play each input within a array
(But that part is quiet). Could someone help me with that expression? Hugs!
Note: The expression in this case would be language independent. If I am going to use such a method or such language (java, c #, javascript), then I will use the% required% for libs
.
Hugs! =)