perl /tmp/yape.pl
The Expression matched, resulting variables were discovered. :
gameid: 12345
content: > hello world fooo bar
gamestate: 1288
Used Expression:
(?msix:
(?&opengamediv) (?# opening div contating start of data )
id="(?<gameid>\d+)-game" (?# gameid --> id='12345-game' -> 12345 )
(?<content>.*?) (?# Skip a lot of content non-greedily )
(?&comment_open) (?# open comment contatining status )
=\s*(?<gamestate>\d+) (?# gamestatus=12344 -> 12344 )
(?&comment_close) (?# closing comment to make sure we get all digits )
(?# Rules )
(?(DEFINE)
(?<opengamediv><div\s* class="game"\s* )(?# This comes before our data )
(?<comment_open> <!--gamestatus\s* )(?# game status in a comment )
(?<comment_close> --> )(?# overkill )
))