Regualar expression: <img[^>]+src\s*=\s*['"]([^'"]+)['"][^>]*>
This works fine when ‘src’ is in lowercase and manages both single and double quotes.
I would like this expression to return matches for following test data
1. <html><img src ="kk.gif" alt="text"/></html>
2. <html><img Src ="kk.gif" alt="text"/></html>
3. <html><img sRC ="kk.gif" alt="text"/></html> (any charcter in 'src' can be uppercase/lowercase)
4. <html><img SRC ="kk.gif" alt="text"/></html>
5. <html><img src ='kk.gif' alt="text"/></html>
Create the pattern with the CASE_INSENSITIVE flag. See
Pattern.compile(String, int). This will affect the entire string, which means theimgalso.Or the cheap way, change
srcto[Ss][Rr][Cc]. This will just affect thesrcportion.