Here a question arose about the CamelCase remark . With the tchrist post combination, I wonder what the correct utf-8 CamelCase is .
Starting with regex (brian d foy's):
/ \b # start at word boundary [AZ] # start with upper [a-zA-Z]* # followed by any alpha (?: # non-capturing grouping for alternation precedence [az][a-zA-Z]*[AZ] # next bit is lower, any zero or more, ending with upper | # or [AZ][a-zA-Z]*[az] # next bit is upper, any zero or more, ending with lower ) [a-zA-Z]* # anything that left \b # end at word /x
and changes:
/ \b
You have a problem with lines labeled "###".
Also, how to change the regular expression for tolerance than numbers, and underscore is equivalent to lowercase letters, so W2X3 is a valid CamelCase word.
Updated: (ysth comment)
for the next one
any : means "upper or lower case or number or underscore"
The regular expression must match CamelWord, CaW
- start with uppercase
- optional
- lowercase letter or number or underscore
- optional
- upper case letter
- optional
Please do not mark as duplicate, because it is not. the original question (and the answers too) was conceived only by ascii.
jm666 source share