|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Jan 14, 2016 10:31 pm Post subject: |
|
|
Agree, a better and more complete example would be:
Code: | '#^https?://[\w\.]*\.smarty\.net$#i' |
Thanks for the heads up. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Jan 15, 2016 12:29 am Post subject: |
|
|
Your one isn't much better as it directly contradicts the article. It will i.e. disallow http://smarty.net/
Something like Code: | #^https?://(?:\w+(?:\-\w+)?\.)*smarty\.net$# | would be correct. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Jan 15, 2016 10:31 pm Post subject: |
|
|
Agree, I didn't test my expression. If you want be more correct, RFC 1123 does not allow underscores so \w is not exactly appropriate. [a-zA-Z0-9] would be. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sat Jan 16, 2016 7:58 am Post subject: |
|
|
Underscores are silently converted to dashes, IIRC. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|