.NETGURU
need a reg ex
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngreg' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Brian Bilbro
I wonder if you regex gurus can help me with the following regular
expression:

I need to change this:

javascript:submitForm('123456');

to

?msgid=123456

where 123456 is a sequence of digits that may not always be 6 in length.

TIA,
Brian

Reply to this message...
 
    
Steven A Smith (VIP)
Does it have to be a regex? You could just do

strX = Replace(strX, "javascript.submitForm('","?msgid=")
strX = Replace(strX, "');","")

Steve

Steven Smith
President, ASPAlliance.com
http://aspalliance.com The #1 ASP.NET Community
http://aspsmith.com ASP.NET Training for ASP Developers
Click here to reveal e-mail address
----- Original Message -----
From: "Brian Bilbro" <Click here to reveal e-mail address>
To: "aspngreg" <Click here to reveal e-mail address>
Sent: Thursday, September 06, 2001 12:56 AM
Subject: [aspngreg] need a reg ex

[Original message clipped]

Reply to this message...
 
    
Brian Bilbro (VIP)
It doesn't have to be regex, but the second line you have
> strX = Replace(strX, "');","")
wont work for me because ");" could appear in other places for other
reasons.

I know I can do it with some simply string searching and replacing...but I
thought if there was a one liner regex I'd use that.

--
Brian

----- Original Message -----
From: "Steven A Smith" <Click here to reveal e-mail address>
To: "aspngreg" <Click here to reveal e-mail address>
Sent: Thursday, September 06, 2001 7:30 AM
Subject: [aspngreg] Re: need a reg ex

[Original message clipped]

Reply to this message...
 
    
Brian Bilbro (VIP)
I ended up using this:

strReturn =
Regex.Replace(strInput,"javascript:submitForm\('(\d*)'\)\;","msgid=$1")

--
Brian

----- Original Message -----
From: "Brian Bilbro" <Click here to reveal e-mail address>
Sent: Thursday, September 06, 2001 9:38 AM

[Original message clipped]

Reply to this message...
 
 
System.Text.RegularExpressions.Regex




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification