0

I have this route set up:

routes.MapRoute(
    "Competition",
    "{comp_id}/Competition/",
    new { controller = "Competition", action = "Index" },
    new { comp_id = @"^[a-zA-Z0-9]{6}$" }
    );

The regex is supposed to allow 6 character competition ids that can have alphanumeric characters and is not case sensitive. What I would like to do is allow the id to be greater than 3 characters long with no restriction in length.

Can someone help me with that?

1 Answer 1

1

This is just basic regex. Use {3,} instead of {6} if you mean that it needs to be 3 or more characters, or {4,} if you mean that it has to be greater than 3.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.