Ahmad
Ahmad

Reputation: 1

Regular expression for the Mask="h:mm tt" MaskType="DateTime"

There are so many resources that it is confusing and many are commented with users saying this does not work etc.

can any one please give me a perfect regex for Mask="h:mm tt" MaskType="DateTime" to be used in my silverlight project

Upvotes: 0

Views: 270

Answers (1)

aorcsik
aorcsik

Reputation: 15552

If you want to match something like this: Mask="h:mm tt" MaskType="DateTime"

This is a regex for it:

Mask="(1[0-2]|[0-9]):([0-5][0-9]) (am|pm)" MaskType="(.+?)"

Your match will contain:

  1. hours
  2. minutes
  3. AM/PM
  4. value of MaskType

You should specify in the question what you want to match for.

Upvotes: 1

Related Questions