The code uses the following regular expression
img[src~=(?i)\\.(png|jpe?g)]
I’m not sure if the . is escaped or the \
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
the
\is escaped, which appears to be an error given what it’s trying to do….actually, you’ve taken that out of context. that’s probably in a string. if it’s in a string, then it’s escaping the slash, and then that slash is escaping the dot.
the
~=means “ends with” and the(?i)switches it into case-insensitive mode.errr… now that i think about it, that actually looks like a hybrid between a CSS selector (probably used in jquery) and a regex (being familiar with both syntaxes, I thought nothing of it!). The
~=doesn’t do anything in a regex (they’re literal chars) the[and]represent a character set though.So…I don’t know what the result of this is. I suspect someone got confused and tried mixing the two.