Regular Expressions 101

Match stackoverflow urls

Open Workspace
  • PCRE (Legacy)
  • Match
0

Regular Expression

/
(^(?:stackoverflow\.com)?[\/]*([cv|users|story]?[\/\w\-\.]*)$)|(^(?:http?:\/\/|https?:\/\/)?(?:www\.)?stackoverflow\.com\/(?:\/*)([\w\-\.\/\%]*))
/
gm

Description

Get only the profile part without the url.

Submitted by Chocksy