Regular Expressions 101

Community Patterns

1...45678...902

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

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

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 - 3 years ago (Last modified 3 years ago)