Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cannot use ^(hat) in parentheses regular expression

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

^means match the beginning of a line, rather than beginning with ., so adding ^ will not match.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading