Hi, I cannot find a way to create a regular expression that allows to enter a space character. How can I do that?
Hi, I cannot find a way to create a regular expression that allows to enter a space character. How can I do that?
Hi Peter,
A "\s" will allow any whitespace (including tabs, etc.) but if you want space only, I believe that you could do "[ ]" (without quotes).
Thanks for the information. I did not find this in the reference documentation. Did I look in the wrong place? Is there some place in the documentation, where the regular expression syntax you are using is documented?
It works somehow. However, I found that I need to enter the space in the edit control as Ctrl-Space, just hitting the Space key alone does not work. Is there a way to make the Space key work?
Hi Peter,
There is info about the mask syntax in this topic "Actipro Editors / Other Controls / MaskedTextBox". It doesn't look like we mention that whitespace is ignored there, so we'll add a note on that for the next version.
I modified our MaskedTextBox Masks QuickStart and added this predefined mask as a test:
new PredefinedMask(@"\d+[ ]\d", "Test")
It allows digits followed by a space and then a digit. That seemed to work fine with the space key for me. Are you able to repro the space not working in this sample with a different mask? Please let us know ASAP since we are about to push out the 2015.1 version.
Please log in to a validated account to post comments.