This is the PHP regular expression I would like to convert into a JavaScript regular expression:
/(?<!\..|\...|\....)([\?\!\.]+)\s(?!.\.|..\.|...\.)/u
Are there tools to do such a conversion?
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.
(?<!stuff goes here)is a negative lookbehind which isn’t supported by JavaScript’s regex implementation. There are some ways to mimic it, but it does not work properly for all cases – yours looks like one of those to me.If you want to keep using this specific regex, but from JavaScript, you could consider simply passing the string to PHP using Ajax, which would then run the regex on it.