If you want to use info.magnolia.ui.form.validator.definition.RegexpValidatorDefinition
:
Before anything, you want to make sure you regex is correct
Add your field validation configuration as described in the Magnolia CMS documentation.
Example of URL-friendly string validation
That's what my validation does: Only characters allowed (without the quotes): "a" to "z" (no accents/diacritics allowed & only lower case), "0" to "9", ".", "_", "-".
That's the regex pattern used: [a-z0-9._-]+
Feel free to test it on regexplanet.com/advanced/java/index.html
Add the relevant config to the dialog:

Find below the "validators" node config. Save this as in an xml file & import it.
<?xml version="1.0" encoding="UTF-8"?>
<sv:node sv:name="validators" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>mgnl:contentNode</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>112b96c1-b942-4657-9541-f8776c74d68d</sv:value>
</sv:property>
<sv:property sv:name="jcr:createdBy" sv:type="String">
<sv:value>admin</sv:value>
</sv:property>
<sv:property sv:name="mgnl:created" sv:type="Date">
<sv:value>2016-11-17T19:26:09.240+01:00</sv:value>
</sv:property>
<sv:property sv:name="mgnl:createdBy" sv:type="String">
<sv:value>superuser</sv:value>
</sv:property>
<sv:property sv:name="mgnl:lastModified" sv:type="Date">
<sv:value>2016-11-17T19:26:41.771+01:00</sv:value>
</sv:property>
<sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
<sv:value>superuser</sv:value>
</sv:property>
<sv:node sv:name="urlCharacters">
<sv:property sv:name="jcr:primaryType" sv:type="Name">
<sv:value>mgnl:contentNode</sv:value>
</sv:property>
<sv:property sv:name="jcr:uuid" sv:type="String">
<sv:value>4d52be80-7211-44d4-8d0a-53a50aed9bc9</sv:value>
</sv:property>
<sv:property sv:name="class" sv:type="String">
<sv:value>info.magnolia.ui.form.validator.definition.RegexpValidatorDefinition</sv:value>
</sv:property>
<sv:property sv:name="errorMessage" sv:type="String">
<sv:value>Only characters allowed (without the quotes): "a" to "z" (without accents), "0" to "9", ".", "_", "-". And only lower case.</sv:value>
</sv:property>
<sv:property sv:name="jcr:createdBy" sv:type="String">
<sv:value>admin</sv:value>
</sv:property>
<sv:property sv:name="mgnl:created" sv:type="Date">
<sv:value>2016-11-17T19:26:41.772+01:00</sv:value>
</sv:property>
<sv:property sv:name="mgnl:createdBy" sv:type="String">
<sv:value>superuser</sv:value>
</sv:property>
<sv:property sv:name="mgnl:lastModified" sv:type="Date">
<sv:value>2016-11-18T11:30:51.883+01:00</sv:value>
</sv:property>
<sv:property sv:name="mgnl:lastModifiedBy" sv:type="String">
<sv:value>superuser</sv:value>
</sv:property>
<sv:property sv:name="pattern" sv:type="String">
<sv:value>[a-z0-9._-]+</sv:value>
</sv:property>
</sv:node>
</sv:node>