Regular Expressions 101

Match instagram URLs

Open Workspace
  • PCRE2 (PHP)
  • Match
1

Regular Expression

/
https?:\/\/(?:www\.)?instagram\.com\/(?:(?:((?:reels)|p)\/(\w+))|((stories)\/(\w+)\/\d+))
/
gm

Description

Matches instagram urls for posts, reels, and stories

works on all flavors except rust

Submitted by User9684