Quantcast
Channel: Extract plain-text xhtml data in php (regex)? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by SomeDude for Extract plain-text xhtml data in php (regex)?

$
0
0

I think this regex will work :

@class:\s*rtm_due\nspan:\s*\[{.*}, {'#text':\s*(.*),\s*'@class':\s*'rtm_due_value'}]

Demo herebut for only due date

If you want location you need to chagne regex to :

@class:\s*rtm_location\nspan:\s*\[{.*}, {'#text':(.*),\s*'@class':\s*'rtm_location_value'}]

the group 1 should give the desired value.

This is the output I got in one of the php regex testers available online :

    [0] => @class: rtm_duespan: [{'#text': 'Due:', '@class': 'rtm_due_title'}, {'#text': 'Sat 16 Jul 16', '@class': 'rtm_due_value'}]    [1] => 'Sat 16 Jul 16'

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>