There is such a code html page:

<script></script> <script type="text/javascript"> var count = 86193; var hour,min,sec; var timer = $.timer( function() { count--; hour = parseInt(count/3600); min = parseInt((count - hour*3600)/60); sec = parseInt(count - (hour*3600+min*60)); $('.count_hour').html(hour); $('.count_min').html(min); $('.count_sec').html(sec); }, 1000, true ); </script> 

You need to get a number from count = 86193 How can this be done? And if the title of the question does not answer the content then write below how you wrote it.

Reported as a duplicate by jfs python Jan 16 '18 at 7:50 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

     import re s = ("var count = 86193;") start = 'count = ' end = ';' result = re.search('%s(.*)%s' % (start, end), s).group(1) print(result) 
    • And if there is no 861943, but let's say 1. - Sasha294
    • @ Sasha294 Without a difference. Everything between start and end. - Hombre
    • very inflexible RegEx. account = 11; or count = "str"; - also sparsit, although it should not, var count=11; and var count =11; not sparsit, although it would be logical to disassemble them ... - MaxU
    • @MaxU It works and let it work - Sasha294