PHP preg_match: a pattern which satisfies all MySQL field names (including 'table.field' formations)
- by gsquare567
i need a pattern which satisfies mysql field names, but also with the option of having a table name before it
examples:
mytable.myfield
myfield
my4732894__7289FiEld
here's what i tried:
$pattern = "/^[a-zA-Z0-9_]*?[\.[a-zA-Z0-9_]]?$/";
this worked for what i needed before, which was just the field name:
$pattern = "/^[a-zA-Z0-9_]*$/";
any…