I am really struggling to find a solution to this i want to find every instance of a number in a paragraph of text.
<div id='text'>
this is the number 20px and this is the number 100 and this is the number 10.
</div>
So i want to take this and have it ouput the following. 20 100 10
<script type="application/javascript">
$(document).ready(function() {
var text = $('.text').text().toString().search( new RegExp( /^[0-9]+$/ i ) );
alert(text);
});
</script>
from the alert i just want it to output the numbers in the text i.e 20 100 10, i now this is way off but any help to put me in the right direction i am banging my head against a wall, thanks.
/\d+?/, can't think of the right funcs right now.