Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2014-12-02 10:30
Flavor·PCRE (Legacy)

/
((<div[\s]+?id=\"fb-root\"[\s\S]+?<\/div>)*[\s]*(<script[\s\S]+?\/script>)*[\s]*(<div[\s]+?class=\"fb-post\"[\s\S]+?(<div[\s]+?class=\"fb-xfbml-parse-ignore\"[\s\S]+?<\/div>)*<\/div>)*)
/
Open regex in editor

Description

This pattern matches to the facebook post embed codes. It matches on each parts of the whole embed code individualy, and matches on the complete embed code either.

Submitted by kristian tanacs