/(?![a-z]+:)/
Anyone knows?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
the
/are delimiters.?!is negative lookahead.[a-z]is a character class (any character in the a-z range)+is one-or-more times of the preceding pattern ([a-z]in this case):is just the colon literalIt roughly means “look ahead and make sure there are no alpha characters followed by a colon”.
This regex would make more sense if it had a start of string anchor:
/^(?![a-z]+:/, so it wouldn’t matchabc:(like one of the other answers say), but without the (^) I don’t know how useful this is.