I'm refactoring this regular expression C# string into a constant and I'm not sure how best to name it (my regex fu is weak).
@"^(?!\s\s)"
Doesn't the question mark denote something that's optional? What is the question saying is optional?
I've found that, as a developer, you have to clearly understand something before you can properly name it (also: Naming is Hard), so I want to clearly understand this and then give it a proper name.
What is the name of this regular expression?
I'm considering LinesThatDoNotStartWithTwoSpaces
or DoesNotStartWithTwoSpaces
.
I always trying to use
Not
in variable name. For exampleNotHuman
, its meaning will change with the definition ofHuman
. Also, variable name should tells what-this-is but not what-this-can-do, so I think it's not a good idea to use verb in variable name, such asSearch
,Match
.For your case, how about
LineWithoutIndentation
, similar to the propertytext-indent
in CSS3.