Javascript regex problem

C

Chris McKenzie

Hi, I'm using IE 6, and I'm doing some RegEx replacement on the client. Here's my code:

regExStr = "\\d{2}:\\d{2}"; // where pattern matches ##:##

regExStr += "(?=\\s)"; // and the next character is a space

regExStr += "(?<=\\s\\d{2}:\\d{2})"; // and the preceding characters match " ##:##" (i.e., not ##:##:##)

r = new RegExp(regExStr);


s = s.replace(r, "$&:00 "); // replace hh:mm with hh:mm:ss



The problem is that the javascript doesn't seem to recognize any pattern using the (?:!=) constructs. I get a client error stating that there's an error in the RegEx.

First, am I wrong in thinking that IE6 javascript supports teh full RegEx library?

2nd, is there a simple workaround? For now, I'm going to break this out into a series of tests, and do the replacement in code. But my curiosity is picqued.

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,224
Latest member
BettieToom

Latest Threads

Top