I have a list of words that need to be made human readable, such as FirstName to Name Name, LastName to Last Name, and in some cases, abbreviations like ARB remain as they are. The latter was recently introduced and caused a mapping problem as our regular expression returns AR Bs . Here, what we have, that I know, is not enough for abbreviations:
([AZ][az]+)
I found other expressions on SO and on other sites that can work with abbreviations, however they work with strings where the abbreviation is inside the string, and not as a whole string. I can do simple regular expressions, but it's too complicated for my skills. I would provide other examples for testing if I had them, but all the lines work fine except for the new ARB. Thanks.
Update: code is used here
string friendlyName = Regex.Replace(field.Name, "([AZ][az]+)", " $1", RegexOptions.Compiled).Trim();
Mathachew
source share