Regular Expressions 101

Community Patterns

Steam ID Regex

2

Regular Expression
PCRE (PHP <7.3)

/
(?<CUSTOMPROFILE>https?\:\/\/steamcommunity.com\/id\/[A-Za-z_0-9]+)|(?<CUSTOMURL>\/id\/[A-Za-z_0-9]+)|(?<PROFILE>https?\:\/\/steamcommunity.com\/profiles\/[0-9]+)|(?<STEAMID2>STEAM_[10]:[10]:[0-9]+)|(?<STEAMID3>\[U:[10]:[0-9]+\])|(?<STEAMID64>[^\/][0-9]{8,})
/
g

Description

Will match and assign to named groups any form of identification for a steam user. Note that profile links and steamid64s are exclusive, preferring the more specific definition to the other, as well as is the case with customurls and full custom profile links.

Submitted by jokleinn - 8 years ago