Tuesday, 15 June 2010

c# - How can i make my regular expression work? -



c# - How can i make my regular expression work? -

i new both .net (c#) , regular expressions.

i need regular look match against url:

if url string contains "/id/whatever_comes_here_every_char_accepted/" : homecoming true

if url string contains "/id/" : homecoming false

i have tried next returns true if url http:// localhost/id/

this script:

string thisurl = httpcontext.current.request.url.absolutepath; match match = regex.match(thisurl, @"/id/*$");

what doing wrong?

when utilize start signals 0 or more of preceding char shall present. want utilize "/id/.+" signal @ to the lowest degree 1 more char must come after /

c# .net regex

No comments:

Post a Comment