January 2nd, 2014, 03:54 AM
Iframe allowed for certain domains regex
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):
here is the regex that triggers it:
youtube.com, youtu.be, youtube.com.br, vimeo.com, player.vimeo.com
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:
January 6th, 2014, 05:46 PM
The "|" will not have the intended affect in the character class (unless you really intend it as a literal character?). Also you need to make sure that those domains are not used as subdomains of some other domain. Don't forget to escape each "." so they are not interpreted as "any single non-newline character".
If that doesn't work, you may need to escape the slashes. Keep in mind that some regex implementations don't support look-arounds.