Regex length

C

Cyber

Hi.

we have a feature where the user can create a regular expression to do
a mask edit (pattern) on a specific field. This field cannot have more
than 5 characters.

We want to validate the user regular expression so it cannot have more
than 5 characters (restrictions on the database). Is it possible with
the Regex class?

For example the user puts this

P\d{4}

Will give P0001 in the mask edit.

But if he puts this:

P\d{144}

It will give a bigger value. Note that the user can create any regular
expression. We want just a code that, evaluating the expression, gives
us the length of the resulting mask.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top