Print Page | Close Window

Add more ways to write URLs in (U)BBcode

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Suggestions
Forum Description: Do you have any ideas for applications or content on Web Wiz? Then leave your suggestions here.
URL: https://forums.webwiz.net/forum_posts.asp?TID=30935
Printed Date: 29 March 2026 at 7:40am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Add more ways to write URLs in (U)BBcode
Posted By: Jagoop
Subject: Add more ways to write URLs in (U)BBcode
Date Posted: 16 January 2014 at 10:02pm
Web Wiz Forum version 10.17 recognizes the following way of writing an URL in (U)BBcode:

[URL=http://www.google.com/][/URL]


But it does not support the other common way of writing an URL (with "):

[URL="http://www.google.com/"][/URL]


I would suggest updating the RegExp in functions_format_post.asp from:

\[URL=\s*([^\]]+)\s*\]\s*([^\]]+)\s*\[\/URL\]

To:

\[URL=\s*"?([^\]]+)"?\s*\]\s*([^\]]+)\s*\[\/URL\]

In order to support both ways of writing URLs.



Replies:
Posted By: Jagoop
Date Posted: 16 January 2014 at 10:24pm
I just played around with the RegExp a bit more, and came up with a better solution:

        .Pattern = "\[URL=\s*\s*""?\s*([^\]]+)\s*""?\s*\s*\]\s*([^\]]+)\s*\[\/URL\]"

This pattern also handles the (in my experience) rather common issue with users copying an URL and accidentally include one or more whitespace characters before or after the URL.


Posted By: WebWiz-Bruce
Date Posted: 17 January 2014 at 8:43am
Thanks Jagoop, will look at adding this in the next release.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net