Data producers may want all variable labels to follow a certain format (e.g., start with the variable number, be in sentence case, etc.). Beyond visual inspection, there are no good tools for detecting deviations from the desired pattern.
Implementation ideas
A potential algorithm might be:
Get the list of (all) variables
Loop over each variable
Extract its variable label via local var_label : variable label varname
Determine whether the label matches the user-provided regex pattern
If not, then include the variable name in a local that compiles variables whose labels fail to follow the desired pattern
Return the list of variables whose label fails to follow the pattern
Problem
Data producers may want all variable labels to follow a certain format (e.g., start with the variable number, be in sentence case, etc.). Beyond visual inspection, there are no good tools for detecting deviations from the desired pattern.
Implementation ideas
A potential algorithm might be: