Community Patterns

Community Library Entry

1

Regular Expression
Created·2021-08-03 06:06
Updated·2021-10-05 06:44
Flavor·PCRE2 (PHP)

/
^(?:https?:\/\/)((?:www\.)|(?:m\.))?soundcloud\.com\/[a-z0-9](?!.*?(-|_){2})[\w-]{1,23}[a-z0-9](?:\/.+)?$
/
gm
Open regex in editor

Description

SoundCloud doesn't have usernames in their URLs, but the user can customize their url with the following rules for what comes after soundcloud.com/:

• Use only numbers, lowercase letters, underscores, or hyphens. • Profile URLs must not start or end with an underscore or hyphen. • Profile URLs must not have two consecutive underscores or hyphens. • Profile URLs must be between 3 and 25 characters.

Submitted by Dylan