I am going to write a parser for a language that must have strict syntax rules about type names, variables, etc. For example, all classes must be PascalCase, and all variable / parameter names and other identifiers must be camelCase.
For example, it is HTMLParsernot permitted and should be specified HTMLParser. Any ideas for regex that might match what PascalCase is, but don't have two capital letters in it?
HTMLParser
camel:
^[a-z]+(?:[A-Z][a-z]+)*$
PascalCase:
^[A-Z][a-z]+(?:[A-Z][a-z]+)*$
/([A-Z][a-z]+)*[A-Z][a-z]*/
, , HTMLParser .
, (, -, ), - ( )
/([A-Z][a-z0-9]+)*[A-Z][a-z0-9]*/
- : " ", , , , , .
.
Source: https://habr.com/ru/post/1729263/More articles:.Net Method to Convert String Characters to HTML Escape - htmlThe following value in std :: map - c ++Inheriting with MongoMapper: Finding a Parent Class - ruby | fooobar.comRecursion Too Big Error When Using Intanceof Over Typeof? - javascriptЕсть ли хороший источник для мозговых дразнилок лямбды - c#Keeping IDs between pages throughout the day? - asp.netobject created using the "new" keyword and created with reflection - javaFinding information about laboratory information systems - scientific-computingThe batch file cannot immediately see the environment variables created by the InstallShield script - environment-variablesC ++: casting to void * and vice versa - c ++All Articles