1

In C# I am using this regex:

 string pattern = @"(?<!"")\:([^\:]*)\:";

and it is working fine but when I try to use it in JavaScript it gives Syntax error:

var pattern = /(?<!"")\:([^\:]*)\:/g;

Can you let me know the issue with that regex with JavaScript?

6
  • 6
    javascript does not support lookbehinds.. ?<!...) Commented May 26, 2015 at 17:15
  • Okay. Can you suggest the regex I should use then? Commented May 26, 2015 at 17:19
  • @raj: what do you want to do with this regex? Matching? replacing?... Commented May 26, 2015 at 17:21
  • 1
    blog.stevenlevithan.com/archives/mimic-lookbehind-javascript Commented May 26, 2015 at 17:22
  • 1
    Can you explain what you want the expression to find and give an example of sample inputs/matches? Commented May 26, 2015 at 17:24

1 Answer 1

1

JavaScript do not support Zero-width negative lookbehind assertion.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.