const contentWithVideo = `
<p><br></p>
<video style="max-width: 50%; height: auto;" controls="">
<source src="http://chartbeat-datastream-storage.s3.ap-south-1.amazonaws.com/wp-content/uploads/2024/08/1723616374/SampleVideo_1280x720_30mb.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>`;
// Find the <video> tag with its source URL
const videoTagRegex = /<video[^>]*>s*<sources+src=['"]([^'"]+)['"]s+type=['"]([^'"]+)['"][^>]*>s*</video>/is;
// Using exec() to match the content
const matchResult = videoTagRegex.exec(contentWithVideo);
the code must match the video tag in given variable but its returning null
- i have tried various methods but nothing is working
if anyone understand where i m going worng please let me know
i have tried changing the expression at first but soon i understand match() is not working with regex