Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
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

Description

parses user/repo

Submitted by luckydonald - 9 years ago