Iframe allowed for certain domains regex

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
basher400
Forum Newbie
Posts: 5
Joined: Mon Mar 27, 2006 1:17 am

Iframe allowed for certain domains regex

Post by basher400 »

hi

I'm messing around with the settings in my IMPERVA admin panel.
when it comes across iframes it disallowed it.
I would like to allow it for certain domains I trust ("white" list):

Code: Select all

youtube.com, youtu.be, youtube.com.br, vimeo.com, player.vimeo.com


here is the regex that triggers it:

Code: Select all

(<\x00*iframe)+[^>]*src[\s\x00]*\=


I need the regexp to NOT trigger (not match) in case of the above domains.

what should be the right regex for this?
by the way is this POSIX, right ?

this is as far as I got but it doesn't work:

Code: Select all

(?iU)(<\x00*iframe)+[^>]*src[\s\x00]*\=["|']?(?:http:\/\/|https:\/\/|\/\/|http:\/\/www\.|https:\/\/www\.|\/\/www\.)(?!youtube\.com|youtube\.com\.br|vimeo\.com|player\.vimeo\.com)
Post Reply