Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Miva - MySQL Regex Validation
<!--
https://www.miva.com/forums/forum/designers-and-developers/mivascript-miva-merchant-empresa/8538-regular-expressions#post171523
-->
<mvt:assign name="g.Pattern" value="'^Foo(bar)?'" />
<mvt:assign name="l.settings:query:query" value="'SELECT \'foo\' REGEXP ?'" />
<mvt:assign name="l.settings:query:bind_parameters[1]" value="g.Pattern" />
<mvt:item name="sql" param="l.settings:query" />
Foo=&mvt:query:results;
<hr>
<mvt:assign name="l.settings:query" value="''" />
<mvt:assign name="l.settings:query:query" value="'SELECT \'Foobar\' REGEXP ?'" />
<mvt:assign name="l.settings:query:bind_parameters[1]" value="g.Pattern" />
<mvt:item name="sql" param="l.settings:query" />
Foobar=&mvt:query:results;
<hr>
<mvt:assign name="l.settings:query" value="''" />
<mvt:assign name="l.settings:query:query" value="'SELECT \'baz\' REGEXP ?'" />
<mvt:assign name="l.settings:query:bind_parameters[1]" value="g.Pattern" />
<mvt:item name="sql" param="l.settings:query" />
baz=&mvt:query:results;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment