What is the regular expression that would find all instances of the string “&”, but not if the instance is the prefix of the string “ ”.
For example, it would match the “&” in “John & Paul”, but not the “&” in “John Paul”.
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.
What you’re looking for is a negative lookahead (see this answer as well). The syntax would generally be something like:
Which matches any ampersand not followed by
nbsp;