troubleshooting Question

Regex for First Character Captial , Following letters must be lowercase

Avatar of MattKenefick
MattKenefickFlag for United States of America asked on
JavaScriptPerlPHP
5 Comments1 Solution190 ViewsLast Modified:
I have this pretty much perfect except for a minor bug...

What i got is..

$alb = "An Expression That Follows The Rules";
preg_match("/[0-9A-Z+a-z \.\'-]+[^A-Z0-9][^A-Z]/",$alb,$str);

That works....

However..

when i put like

$alb = "An Expression That Follows The RulesBBOAO";
preg_match("/[0-9A-Z+a-z \.\'-]+[^A-Z0-9][^A-Z]/",$alb,$str);


The BBOAO will come through....
How do I make it stop if theres captials without a space before it...
and also it cant be consecutive capitals


Thanks a ton. it took me forever to write the expression up there, lol im not good with these
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros