javascript - Regex matching specific url -
i'm trying test if url wildcard @ end matches one.
^http?://(?:www\\.)?lichess\\.org/?.*
is regex, want match http://en.lichess.org/e2kwzt0y, after .org/ should random.
sorry inconvenience.
try this:
/(http:\/\/en\.lichess\.org\/)((?:[a-z][a-z0-9_]*))/i
like this:
var string = 'http://en.lichess.org/e2kwzt0y'; var match = string.match(/(http:\/\/en\.lichess\.org\/)((?:[a-z][a-z0-9_]*))/i); if(match && match.length){ console.log('match found'); }
Comments
Post a Comment