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 June 11th, 2004, 11:07 AM
Authorized User
 
Join Date: Jun 2003
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default vbTab in regEx

I have a word document that needs to be turned into a database for a telephone directory everything is tab delimited but with lots of tabs used to line things up. so I need a regular expression that will search for 2 or more tabs so that i can use the replace function to change then to a single tab.

in other words

<%
dim regTooManyTabs
regTooManyTabs = new regExp
regTooManyTabs = "[\t+]"

replace(text, regTooManyTabs, vbTab)
%>
is this going to work?
 
Old June 12th, 2004, 02:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Done something similar using Javascript.

Code:
<script language="javascript">
String.prototype.fullTrim = function(){
 theString = this.replace(/\t+/g,"\t");
 theString = theString.replace(/^\t*([\S\s]*\S+)\s*$/,"$1");
 document.frm.txt2.value=(theString==" ")?"":theString;
}
</script>

<form name="frm">
<textarea name="txt1" onBlur="this.value.fullTrim()" rows=5 cols=100>This text has a <tab>(    )here, 2(        )here, and 4(                )here</textarea>
<br>
<textarea name="txt2" rows=5 cols=100></textarea>
</form>
Try to initiate onblur event on TEXTAREA 1 to see the effect.
Let me find you out that in ASP.
Cheers!

_________________________
-Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
regex mrame XSLT 12 July 25th, 2008 09:37 AM
Regex htran XSLT 2 May 18th, 2005 09:21 AM
More regex help Snib Pro PHP 4 December 16th, 2004 09:56 PM
Need RegEx help Snib Pro PHP 6 November 16th, 2004 06:59 AM
Regex Help boyer99g General .NET 2 October 8th, 2004 05:46 PM





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