Underscore naming convention regex -
what regex variables using underscore naming convention?
- starts letter
- list of words (in can use numbers) separated underscores
- everything lower case
for sake of research, remind first naming conventions important part of programming. there lot of debate them, here on se.
as specific use case, wanted use xsd validation process described in xml. imported database fields used keys, wanted restrict naming classic "underscore separated" naming convention.
i surprised find out question has been asked. reference find on description in software designed check coding style written java.
the closest thing wanted was
^[a-z][a-z0-9]*(_[a-z0-9]+)*$
i suggest using :
[a-z][a-z0-9]*(_[a-z0-9]+)* note same pattern can used constants_naming_convention replacing a-z parts a-z.
Comments
Post a Comment