Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
Created·2016-03-09 20:31
Flavor·Python

r"
^\#\s* # must start with "#" to indicate beeing a repo. (?:@?@?(?!-)(?P<user>(?:[a-zA-Z0-9]|-(?!-))+[a-zA-Z0-9])(?![^\x00-\x7F]))? # Username part (?:(?<=\#)|[/\s\.](?<!\v))(?P<repo>[a-zA-Z0-9_.-]+)$
"
gmix
Open regex in editor

Description

parses user/repo

Submitted by luckydonald