I want to check if a value for a MySQL Query contain % character (can appear multiple times) but not the escaped \%.
So it should match:
'%test''%test\%''test\\%'– should match because it’s escape the\not the%'%test\%%''\%test%test\%'
but not:
'test\%''\%test\%''\%test\%test\%'
I’m not good in Regular Expression, can someone help me on this?
Thanks in advance.
Edit:
I’m trying creating a PHP Library for generating SQL Query from an array, and maybe the generated query will be used mostly on MySQL.
So, the regex filtering process will be in PHP.
Sorry, I forgot to mention this.
Thanks
Check this on PHP code:
http://ideone.com/Bgq5bV