regular expression
-
I would like to use a regular expression to evaluate text for a specific pattern. Here is the pattern and the rules: (A123.B12345678) the first character must be a letter, it must contain at least one character but no more than 8, no characters other than letters and numbers followed by a . and then the first character must be a letter, it must contain at least one character but no more than 8, no characters other than letters and numbers. I am currently using ^[a-zA-Z]\w*\.+\w{1,8}$ It's close but not quite what I need. All help greatly appreciated!
-
I would like to use a regular expression to evaluate text for a specific pattern. Here is the pattern and the rules: (A123.B12345678) the first character must be a letter, it must contain at least one character but no more than 8, no characters other than letters and numbers followed by a . and then the first character must be a letter, it must contain at least one character but no more than 8, no characters other than letters and numbers. I am currently using ^[a-zA-Z]\w*\.+\w{1,8}$ It's close but not quite what I need. All help greatly appreciated!
Your requirements statement seemed to be a bit ambiguous, so I'm not exactly sure if I nailed it. [a-zA-Z]([a-zA-Z]|\d){0,7}\.[a-zA-Z]([a-zA-Z]|\d){0,7} a.B wanted true is True A6787.f9fds33 wanted true is True v387f56.c wanted true is True c.a546ff6 wanted true is True 234.f3455tt wanted false is False a123,ff00f9 wanted false is False a123..errew wanted false is False a123.a123.a wanted false is False Charlie if(!curlies){ return; }
-
Your requirements statement seemed to be a bit ambiguous, so I'm not exactly sure if I nailed it. [a-zA-Z]([a-zA-Z]|\d){0,7}\.[a-zA-Z]([a-zA-Z]|\d){0,7} a.B wanted true is True A6787.f9fds33 wanted true is True v387f56.c wanted true is True c.a546ff6 wanted true is True 234.f3455tt wanted false is False a123,ff00f9 wanted false is False a123..errew wanted false is False a123.a123.a wanted false is False Charlie if(!curlies){ return; }