J
Jason Carlton
Tricky subject, sorry.
I'm wanting to check a textarea to see if it contains "<img", and if
so, does the section between "<img" and the following ">" contain
"mydomain.com".
This is particularly tricky since there can be more than one
"<img...>" in the field.
I can do this in Perl easily enough:
while ($comment =~ /(<img[^>]+?>)/sgxi) {
if ($1 =~ /mydomain\.com/gi) {
# do whatever
}
}
But how do I create something similar in Javascript?
TIA,
Jason
I'm wanting to check a textarea to see if it contains "<img", and if
so, does the section between "<img" and the following ">" contain
"mydomain.com".
This is particularly tricky since there can be more than one
"<img...>" in the field.
I can do this in Perl easily enough:
while ($comment =~ /(<img[^>]+?>)/sgxi) {
if ($1 =~ /mydomain\.com/gi) {
# do whatever
}
}
But how do I create something similar in Javascript?
TIA,
Jason