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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -