Posted By

rengber on 09/18/06


url String regular Expression Handling

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Regular Expression to Separate the Anchor Part of a URL

 / Published in: C#

Dots match any charecter, this matches any 7 chars. You need to change that bit to match a different pattern.

  1. private string GetAnchorPart()
  2. {
  3. string anchorExp = "[#].......";
  4. Regex rex = new Regex(anchorExp);
  5. Match anchorMatch = rex.Match(Request.RawUrl);
  6. return anchorMatch.ToString();
  7. }

Report this snippet  

You need to login to post a comment.