Click here to Skip to main content
14,974,240 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
AnswerRe: Expression needed Pin
OriginalGriff6-Sep-10 1:27
mveOriginalGriff6-Sep-10 1:27 
Questionhtml tag finder Pin
moein.serpico14-Aug-10 23:14
Membermoein.serpico14-Aug-10 23:14 
AnswerRe: html tag finder Pin
PIEBALDconsult15-Aug-10 8:19
professionalPIEBALDconsult15-Aug-10 8:19 
AnswerRe: html tag finder Pin
OriginalGriff15-Aug-10 8:31
mveOriginalGriff15-Aug-10 8:31 
GeneralRe: html tag finder Pin
AspDotNetDev26-Sep-10 9:29
protectorAspDotNetDev26-Sep-10 9:29 
AnswerRe: html tag finder Pin
AspDotNetDev26-Sep-10 9:28
protectorAspDotNetDev26-Sep-10 9:28 
AnswerRe: html tag finder Pin
Hiren solanki17-Dec-10 0:40
MemberHiren solanki17-Dec-10 0:40 
QuestionDifferences between matches with same RegEx [modified] Pin
RichardGrimmer6-Aug-10 0:00
MemberRichardGrimmer6-Aug-10 0:00 
Guys,
Seems quiet around here, but hey-ho...hopefully I'll get a response.

OK - I have the following Regex:

^https?://([a-zA-Z0-9-_]*[/\.]{1})*([a-zA-Z]^\.)*(aspx)?

Which I've created using an online regex builder[^]

It's intended to match urls on either www. or local network, with or without a page (.aspx) on the end (so either www.site.com/ or www.site.com/page.aspx). The problem I have is that for all cases it seems to work correctly, until I drop it into my C# / Silverlight app (with the 2 x \ escaped as \\).

The problem is that under the regex builder, a .aspx is fine, a .aspxs is flagged as not matching - which is exactly what I need...however, in c# the aspxs is not flagged as invalid.

I think I can see why - because the s is part of the group, it's permitted - so I'm trying to essentially do an Optional literal string...the ? to make it optional, the brackets to apply to the group...but c# seems to be percieving it more as [aspx]* . If I remove the bracket, then the ? only then applies to the x on the end (as with the s in https at the start)...

Any ideas what I've missed here?
C# has already designed away most of the tedium of C++.

modified on Friday, August 6, 2010 6:33 AM

AnswerRe: Differences between matches with same RegEx PinPopular
Peter_in_27806-Aug-10 2:22
professionalPeter_in_27806-Aug-10 2:22 
GeneralRe: Differences between matches with same RegEx - RESOLVED Pin
RichardGrimmer8-Aug-10 22:53
MemberRichardGrimmer8-Aug-10 22:53 
QuestionEven Expresso couldn't help me with this RegEx - Can You? Pin
Sonhospa30-Jul-10 7:19
MemberSonhospa30-Jul-10 7:19 
AnswerRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
Luc Pattyn30-Jul-10 7:57
sitebuilderLuc Pattyn30-Jul-10 7:57 
NewsPartially resolved: Even Expresso couldn't help me with this RegEx - Can You? Pin
Sonhospa31-Jul-10 1:06
MemberSonhospa31-Jul-10 1:06 
GeneralRe: Partially resolved: Even Expresso couldn't help me with this RegEx - Can You? Pin
Luc Pattyn31-Jul-10 2:24
sitebuilderLuc Pattyn31-Jul-10 2:24 
AnswerRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
PIEBALDconsult12-Aug-10 18:07
professionalPIEBALDconsult12-Aug-10 18:07 
AnswerRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
Luc Pattyn12-Aug-10 18:20
sitebuilderLuc Pattyn12-Aug-10 18:20 
GeneralRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
PIEBALDconsult12-Aug-10 18:23
professionalPIEBALDconsult12-Aug-10 18:23 
GeneralRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
AspDotNetDev23-Aug-10 12:37
protectorAspDotNetDev23-Aug-10 12:37 
GeneralRe: Even Expresso couldn't help me with this RegEx - Can You? Pin
AspDotNetDev23-Aug-10 12:44
protectorAspDotNetDev23-Aug-10 12:44 
QuestionAs black as night. Pin
LunaticFringe26-Jul-10 16:50
MemberLunaticFringe26-Jul-10 16:50 
AnswerRe: As black as night. Pin
PIEBALDconsult26-Jul-10 17:59
professionalPIEBALDconsult26-Jul-10 17:59 
GeneralRe: As black as night. Pin
LunaticFringe26-Jul-10 18:24
MemberLunaticFringe26-Jul-10 18:24 
GeneralRe: As black as night. Pin
Roger Wright6-Oct-10 16:00
professionalRoger Wright6-Oct-10 16:00 
GeneralRe: As black as night. Pin
Luc Pattyn6-Oct-10 16:20
sitebuilderLuc Pattyn6-Oct-10 16:20 
GeneralRe: As black as night. Pin
Roger Wright6-Oct-10 19:29
professionalRoger Wright6-Oct-10 19:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.