Regular Expressions 101

Community Patterns

Facebook Regex

1

Regular Expression
PCRE (PHP <7.3)

/
facebook\.com\/ [^\s?]+ (?: \.(\d+)\/(\d+) \S* | \? # Look for 'story_fbid' and 'id' in any order (?=(?:[^\s&]*?&)*?\bstory_fbid=(\d+)) (?=(?:[^\s&]*?&)*?\bid=(\d+)) \S* )
/
gmx

Description

Facebok

Submitted by anonymous - 8 years ago