Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Marios Andreas Tofarides
3
Views
2
Comments
Check whether a string contains no letters
Question
I have a field whose values has to be like "1,2,3,4". I want to make sure that no letters or other characters besides numbers (0-9) and comma (,) are entered.
I have used Regex_search with "(\d+)(,\s*\d+)*" regular expression, but since Regex_search doesn't do a complete match, entries like "1,2,a,4;7" are accepted and saved into the database.
Any suggestions?
Regards,
Nuno Palhinhas
Staff
Hi,
Did you included the beginning and end of string chars (^ ... $)?
Like this:
^
(\d+)(,\s*\d+)*
$
It should work with these.
Nuno
André Vieira
Staff
If you get this from the user's input you might want to consider having an input mask on your input.
There's a forge component for this
.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...