Jump to content

regex


Miko

Recommended Posts

Hello,

 

I'm working on a regular expression for a window.open() javascript function.

 

This is what the string can have:

window.open('http://www.google.com','windowname','width=250,height=250,left='+(screen.availWidth/2-125)+',top='+(screen.availHeight/2-125)+'');return false;

 

This is what I already have for the check:

 

window.open\(\'(\s)*((ht|f)tp(s?)://)[\p{L}\p{N}]+[~\p{L}\p{N}\p{Zs}\-_\.@#$%&;:,\?=/\+!]*(\s)*\'\,\''\,\''\);return false;

 

This works for window.open('http://www.google.com','','');return false;

 

But not yet for the other parameters, someone can help me further with this?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/224332-regex/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.