I tried to capture file extension: get .m3u8 if my filename is ABC.m3u8 for example.
The regular expression I use:
\w+(^\.[A-Za-z0-9]+)
I cannot get the result as my expected if I don’t remove hat(^) character. Please tell me why, thanks.
>Solution :
^means match the beginning of a line, rather than beginning with ., so adding ^ will not match.