What is the regular expression format in data- dojo -props?

What is the format of the regular expression for ...data-dojo-props='regExp:...I have seen that this expression is beautiful ... data-dojo-props="regExp:'[\\w]+',.... But it is very simple. What if the expression is complex, how

^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$

or

^(\+|00)\d{2,3}-\d{1,2}-\d{3}-\d{4}$
+3
source share
1 answer

I do not claim to be a regular expression expert, but I found the following to work. The only change from what you originally posted is a comma that should not be escaped. Is this a valid check?

<input 
  data-dojo-type="dijit.form.ValidationTextBox"
  data-dojo-props="regExp: '^[a-zA-Z]+(([\',\.-][a-zA-Z ])?[a-zA-Z]*)*$'" 
  value="" name="name" id="name">
+2
source

All Articles