I need help building a regular expression for preg_match according these rules:
- first and last char- letter/digit only.
- empty space not allowed
- char can be only - letter/digit/'-'/'_'/'.'
Legal examples:
- b.t612_rt
- rut-be
- rut7565
Not legal example:
- .btr78; btr78- (first/last allowed chars)
- start end; star t end; (any empty space)
- tr$be; tr*rt; tr/tr ... (not allowed chars)
Edit: I remove 4 rule with neigbor chars '_'\'-'\'.'
please help me.
Thanks