473,417 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,417 software developers and data experts.

Wildcards in ASP Replace String

I want to replace everything after a colon (:) in a string using ASP
Replace.

Here's an example of the procedure I want to perform:

dim hr1, hr1replace
hr1 = "H.R. 1908: Patent Reform Act of 2007 (On Passage)"
hr1replace = REPLACE(hr1,": [WILDCARD GOES HERE]","")

so the remaining text is only: H.R. 1908

I'm not sure if this is possible to do - but any suggestions you have
would be greatly appreciated.

THANKS!

Sep 8 '07 #1
3 11130
wrote on 08 sep 2007 in microsoft.public.inetserver.asp.general:
I want to replace everything after a colon (:) in a string using ASP
Replace.
There is no asp replace,
since asp is not a language but a platform,
having vbscript and jscript as languages.
Here's an example of the procedure I want to perform:

dim hr1, hr1replace
hr1 = "H.R. 1908: Patent Reform Act of 2007 (On Passage)"
hr1replace = REPLACE(hr1,": [WILDCARD GOES HERE]","")

so the remaining text is only: H.R. 1908
Use regular expression in vbscript:

hr1 = "H.R. 1908: Patent Reform Act of 2007 (On Passage)"
Set regEx = New RegExp
regEx.Pattern = ":.*$"
hr1replace = regEx.Replace(hr1,"")

or the same in jscript, much nicer:

hr1 = "H.R. 1908: Patent Reform Act of 2007 (On Passage)"
hr1replace = hr1.replace(/:.*$/,"")

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 8 '07 #2
Worked like a charm - couldn't really find the simple answer to this
anywhere.

THANK YOU!

Sep 9 '07 #3
wrote on 09 sep 2007 in microsoft.public.inetserver.asp.general:
Worked like a charm - couldn't really find the simple answer to this
anywhere.
Without quoting usenet users do not know what you are respondning on.
This is not email.

[please always quote on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 9 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Thomas F. O'Connell | last post by:
I've been looking through the negative lookbehind posts and haven't yet found a definitive answer to the question I'm about to ask: Does negative lookbehind have lower precedence than even a...
10
by: Alvaro Puente | last post by:
Hi all! Do any of you know if wildcards are accepted when calling rename() function? Thanks/Alvaro
1
by: mark | last post by:
I have a dumb question, but cannot find an answer: I've got a string like -"The day is Oct 2004 and it is nice outside" -"Today is Nov 2003 and I am hungry" -"The day is Jan 1999" How can I...
2
by: Dennis | last post by:
I am trying to implement a "Find and Replace" dialog that allows using wildcards in the find string, much like the Find and Replace Dialogs in Ms Word, etc. Are there any references or examples on...
1
by: Anandan | last post by:
Hi, This is regarding Dataset Filter: WILDCARD CHARACTERS Both the * and % can be used interchangeably for wildcards in a LIKE comparison. If the string in a LIKE clause contains a * or %,...
3
by: Lou | last post by:
Question: I can't seem to get file.exists(filename) to return true when I search using wildcards, and I know there's a file in that dir with that extension. here's the path dim yesno as...
19
by: Alan Carpenter | last post by:
Access 8 on Win98 and WinXP I'm having trouble with wildcards in the .Filename property of the FileSearch Object giving different results on win98 and XP. I've been successfully using...
1
by: numinix | last post by:
I need to sanitize a string that may contain unidentified character entities represented as \x99, \x98, etc. I need to do a simple str_replace to replace \x** with "". Is there a way to use...
5
by: nidaar | last post by:
From a security point of view, is accepting wildcards like "%" in input parameters of stored procedures against any best practices? As an example, if a user defined function uses "Productname...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.