windows runtime - Regex for parsing Facebook Open Graph meta tag -
i'm trying pull og:title attribute bing local page windows store app. there no html parser winrt , c++/cx, i've resorted using regex grab tag, xml parser pull out relevant attributes.
this tag looks like.
<meta property="og:title" content="some location name"/>
i'm using following regex pull out tag html, whenever content attribute has space in it, fails find match.
<meta property="og:title" content="[\s\s]*"/>
so, regex work mcdonald's, not jack in box.
what need entire title?
this 1 of open graph regex queries match things specific problems in content, rare , i'd rather have more readable regex
<meta [^>]*property=[\"']og:title[\"'] [^>]*content=[\"']([^'^\"]+?)[\"'][^>]*>
but come across times content comes before property run this
<meta [^>]*content=[\"']([^'^\"]+?)[\"'] [^>]*property=[\"']og:image[\"'][^>]*>
Comments
Post a Comment