1

Topic: Help to make the regular expression

Help to make please the regular expression .
On a site there is a line: the Question 1 from 8
In tags html it will be so <span> the Question 1 of 8 </span>
As to me to receive "digit" after a word "from" ;
That is I need to receive digit 8 after a word from
It is impossible to make the regular expression

2

Re: Help to make the regular expression

, https://regex101.com/r/vmD6Q0/1

3

Re: Help to make the regular expression

Prompted at other forum. It is tested - works perfectly

<span> the Question 1 from 8 </span>
<script>
var elem=document.getElementsByTagName (' span ') [0];
num=elem.innerHTML.split (' from ').pop ().trim ();
alert (num);
//Or so
num=elem.innerHTML.match (/\d + $/) [0];
alert (num);
</script>