Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 1st, 2003, 12:46 PM
Registered User
Join Date: Oct 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Placing quotes in attributes


I've been trying to put quotes into html which doesn't have quotes. Its easy in Perl but I'm finding it tricky with vbscript.

Here's an example

strHtml= "<img src=image1.gif width=200 height=100>"

Below works as a regExps pattern but not sure where to go from here - i have tried numerous ways but maybe I'm going down the wrong path!

pattern ="([a-z])+(\=)([a-z]+|[0-9]+)"

I am trying to split the results though - In Perl you would reference each parenthesis contents by $1 $2 $3.

Any Ideas

Old December 1st, 2003, 12:48 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Are you asking two questions here??

You escape a " in VB/Script with, oddly enough, another ":
strHtml= "<img src=""image1.gif"" width=""200"" height=""100"">"

Work smarter, not harder.
Old December 1st, 2003, 01:00 PM
Registered User
Join Date: Oct 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

Sorry its my fault I'm not being clear.

I have some html code that is being sent using post to another page i.e. processhtml.asp

The code that is sent lacks quotes in the attribute - heres a small snippet
"<img src=image1.gif width=200 height=100>"

So I would like to go through the whole code and add the quotes using a function. I can match the attibutes without quotes using
pattern = "([a-z])+(\=)([a-z]+|[0-9]+)"

So from here I would like to split each match and add/replace with quote.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing Session variable KamalRaturi ASP.NET 2.0 Professional 3 September 13th, 2006 04:53 AM
displaying single quotes and double quotes ren_123 Classic ASP Databases 2 February 22nd, 2006 02:17 PM
Dynamic placing of a control Warbird General .NET 1 July 9th, 2004 02:19 PM
Double Quotes and Single Quotes Problem phungleon Classic ASP Basics 7 May 27th, 2004 01:44 PM
Placing processes in the background ohwail C++ Programming 2 September 10th, 2003 11:47 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.