Home > Regular Expression > New Regexp In Javascript

New Regexp In Javascript

Contents

There's a bug in IE7!? The actual validation is thus done in javascript. Obviously, IE doesn't return true for this code below, no matter what you enter. I want to power off multiple Macs everyday at 23:30 (11:30 pm)? have a peek here

If it's coming from .innerHTML, browsers may return a string that is different from what you literally have in the source (for instance, attribute names may be uppercased, or the attributes In short, you should not use a regex for this. C Macro - how to get an integer value into a string literal How would you say "to scold" in a less formal way? Forum New Posts FAQ Calendar Forum Actions Mark Forums Read Quick Links Today's Posts View Site Leaders What's New?

New Regexp In Javascript

What should I pack for an overland journey in a Bronze Age? The ECMAScript standard (section 15.10.2.12) calls for \s to include everything in the Unicode Zs ('Separator, Space') category, which includes U+00A0. –Alan Moore Nov 18 '11 at 2:36 add a comment| Thanks for your help.

Surprised? Mysterious LCD interface without wires Do GUI based application execute shell commands in the background? Of course, the limitation there would be that you would have to have an HTML document that is valid XML (XHTML). I believe older versions of IE strip out quotes around single-word attribute values, which would also mess with your regex.

javascript regex internet-explorer replace share|improve this question edited Nov 17 '11 at 14:54 asked Nov 17 '11 at 13:51 Chobeat 1,09721439 The regex is correct and i tested it .test Javascript Which is easier to read and doesn't cause issues in IE? if (regPattern.test(newPwd)) I tried this if (regPattern.test(newPwd) == "true") but that didnt work either. Can Newton's laws of motion be proved (mathematically or analytically) or are they just axioms?

Not the answer you're looking for? drum roll.............. Ultrasonic Sensors and Pets Why do governments not execute or otherwise permanently contain super villains? Internet Explorer!

.test Javascript

Utensil that forms meat into cylinders How do you write a letter of recommendation for someone who got an A in your class, but who you've never talked to outside of Female has wings while male does not How to find the maximal number of elements of an array? New Regexp In Javascript asked 3 years ago viewed 485 times active 3 years ago Upcoming Events 2016 Community Moderator Election ends in 8 days Blog Stack Overflow Podcast #94 - We Don't Care If Regexp Javascript Where is this building on a mountain in Planet Earth 2?

I use JQuery. How to stop a Linux process for later execution swapping-out its memory Ultrasonic Sensors and Pets Is total distance walked specific to a single Pokémon, or to a species of Pokémon? Optimizing number of IF-Else statements Put two commands after an || Hotels on the Las Vegas strip: is there a commitment to gamble? Remove the quotes: .replace (/<\/A>/i, " "); When you use a string, it's just matched literally, no regular expression processing is done. Regex Tester

  1. Browse other questions tagged javascript regex validation internet-explorer-7 passwords or ask your own question.
  2. Do I need an Indie Studio Name?
  3. My boss asks me to stop writing small functions and do everything in the same loop Is total distance walked specific to a single Pokémon, or to a species of Pokémon?
  4. Texas, USA speed ticket as a European citizen, already left the country Why does this 7-Segment Display not function properly?
  5. Impossible Mentoring Task What could cause humanity to migrate from land to water?
  6. asked 7 years ago viewed 6541 times active 7 years ago Upcoming Events 2016 Community Moderator Election ends in 8 days Blog Stack Overflow Podcast #94 - We Don't Care If

I've tried this piece of code, but nothing happens: var temp_tag="abc x"; alert(temp_tag); temp_tag = temp_tag.replace(/[\s]+x$/, ''); alert(temp_tag) The same piece of code work perfectly on Chrome. In real life HTML is on one line, but I've broken it up here for easier reading. The problem is that for some reason IE won't match even a simple > from the original innerHTML string. Just noticed the JSON object contains two commans: ",," - I think IE will barf on that in the eval() once you get that far. –searlea Aug 6 '09 at 9:45

javascript regex internet-explorer replace share|improve this question edited Jul 26 '13 at 22:38 Kara 3,18573149 asked Mar 19 '13 at 16:36 user2187420 293 IE does things out of the Join them; it only takes a minute: Sign up IE8 is not recognizing my regular expression up vote 1 down vote favorite I'm trying to parse an AJAX response and get EDIT: Probably the regex is not the issue.

I can't do this via jQuery, though, because jQuery can't emulate a DOM response for a body tag.

But I am getting the value returned by the server in an ajax call and there seems to be the issue. You used the g flag - you get an array. Ultrasonic Sensors and Pets What should I pack for an overland journey in a Bronze Age? see here blogs.msdn.com/b/michkap/archive/2005/01/20/357028.aspx (And now the discussion is beginning to get academic :) –HerrSerker Nov 18 '11 at 9:55 | show 1 more comment up vote 0 down vote Try this

Not the answer you're looking for? Not the answer you're looking for? Optimizing number of IF-Else statements Using a barrel jack with higher than rated current but lower voltage? To start viewing messages, select the forum that you want to visit from the selection below.

c# javascript asp.net regex client-side share|improve this question edited Jan 13 '11 at 16:11 asked Jan 13 '11 at 16:05 Xaisoft 16.8k66213361 1 Confused. The expression works just fine on every other browser except (surprise, surprise) Internet Explorer. been linked to insufficient sleep"? How not to lose confidence in front of supervisor?

var passwordRegEx = /^(?=.*\d)(?=.*[a-zA-Z]).{6,25}$/; if(!#quickRegister_Password').val().test(pass)) { errorMgs += 'Your password must be at least 6 characters and have at least 1 number and 1 letter.\r\n'; } It works in Firefox, Chrome, It will break if there are linebreaks within the innerHTML string. (should probably fix that, but since it doesn't happen IRL, who cares) Reply With Quote 02-16-2009,07:41 AM #8 mintedjo View Anyway, that's not the problem, because I don't get any type mismatch errors in any browser.