lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> On 25. Dec 2019, at 18:02, luciano de souza <luchyanus@gmail.com> wrote:
> 
> I could not find a pattern to match urls like:
> http://midia.cmais.com.br/assets/audio/default/CENA_00087___P___24_12_10_1293450448.mp3
> 
> *snip*
> 
> local pattern = '(http://[a-zA-Z0-9_/]-%.mp3)'
> 
> Would someone know a lua pattern to match urls started with "http://";
> and ended with '.mp3'?

Currently not near a computer / can't check if that's all, but I think you just forgot a dot in the character class?

Failing that, maybe try
"http://[^ ]+%.mp3"
which might still work and is simpler. (Also if you capture the full match, you don't need to parenthesize it IIRC.)

-- nobody