Hello,
Can someone tell me how works the ValidationString of an EditBox.
What characters in this ValidationString validate what text?
Thanx
EditBox -> ValidationString
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: EditBox -> ValidationString
Hi,
The validation string is a regular expression. If you're not familiar with RegExs then a google will help you no end there
But basically, something like:
will match (in the case of cegui, this means 'allow you to type') any character any number of times.
And:
Will match the digits 0 to 9 any number of times.
One caveat is that the string being entered must match the regex at all times. This means that for certain advanced possibilities you need to get creative with the regex validation string - most things can be achieved with a little work
HTH
CE.
The validation string is a regular expression. If you're not familiar with RegExs then a google will help you no end there
But basically, something like:
Code: Select all
".*"
will match (in the case of cegui, this means 'allow you to type') any character any number of times.
And:
Code: Select all
"[0-9]*"
Will match the digits 0 to 9 any number of times.
One caveat is that the string being entered must match the regex at all times. This means that for certain advanced possibilities you need to get creative with the regex validation string - most things can be achieved with a little work
HTH
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 4 guests