Hi all,
I need a regex that matches a string like this: 8.120000e+01
I have a HTML table, one of the fields title is "Element Value" and the values for this field will need to be in scientific notation format...
I am using OpenNMS to collect data and am using this HTML page as a data page. The information I would like to be collected is the value of the field called Element Value. This value is in scientific notation format. I need to write a match statement in OpenNMS (using regex) which this match statement will do a search inside that HTML page and matches the value...
Here's my HTML page and a sample "match" statement regex. Help me modify the regex so it works with my format. Thank you!
HTML data page:
<html>
<head>
<title>New page</title></head>
<body>
<br>
<table border="1" width="435"><tr>
<td width="90">Element Name</td><td width="111">Element Var</td><td width="114">Element Value Tag</td><td width="92">Element Value</td></tr>
<tr>
<td width="90">testing_1</td><td width="111">test-0/test1</td><td width="114">value</td><td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
</head>
<body>
<br>
<table border="1" width="435"><tr>
<td width="90">Element Name</td><td width="111">Element Var</td><td width="114">Element Value Tag</td><td width="92">Element Value</td></tr>
<tr>
<td width="90">testing_1</td><td width="111">test-0/test1</td><td width="114">value</td><td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<tr>
<td width="90">Element Name</td><td width="111">Element Var</td><td width="114">Element Value Tag</td><td width="92">Element Value</td></tr>
<tr>
<td width="90">testing_1</td><td width="111">test-0/test1</td><td width="114">value</td><td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="111">Element Var</td><td width="114">Element Value Tag</td><td width="92">Element Value</td></tr>
<tr>
<td width="90">testing_1</td><td width="111">test-0/test1</td><td width="114">value</td><td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="114">Element Value Tag</td><td width="92">Element Value</td></tr>
<tr>
<td width="90">testing_1</td><td width="111">test-0/test1</td><td width="114">value</td><td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="92">Element Value</td></tr>
<tr>
<td width="90">testing_1</td><td width="111">test-0/test1</td><td width="114">value</td><td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
</tr>
<tr>
<td width="90">testing_1</td><td width="111">test-0/test1</td><td width="114">value</td><td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="111">test-0/test1</td><td width="114">value</td><td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="114">value</td><td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="92">9.420000e+01</td></tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
</tr>
<tr>
<td width="90">testing_2</td><td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="111">ctest-0/test2</td><td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="114">value</td><td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="92">1.900000e+00</td></tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
</tr>
<tr>
<td width="90">testing_3</td><td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="111">test-0/test3</td><td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="114">value</td><td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
<td width="92">2.100000e+00</td></tr>
</table>
</body>
</html>
</tr>
</table>
</body>
</html>
This is the match I need to be configured:
matches="(?s).*Element\sValue\n>([0-9\... response-range="100-399"
Thanks in advance!