Regex for valid mysql table field
I'm developing a php application that requires the creation of database fields, based on a source data. This data contains spaces, accents, characteres like slashes etc.
Right now I'm parsing this data, validating spaces, accents, but I would like to do it by a regular expresion that simply returns a valid database field name.
Is this possible ?
If I was told to do this, I would start reading the rules for defining a column name in MySQL. You can read these rules here : http://dev.mysql.com/doc/refman/5.7/en/identifiers.html.
I have selected MySQL 5.7 but read the documentation for your targetd version.