skip to Main Content

Javascript – RegEx "\" doen´t escape correctly

I´m trying to use RegEx to find a website using this RegEx: const RegEx = /h[w]+[://]+w+[.]+[w.=-]+[.]+[w]{2,3}[w/=-]+\/g Websites = document.children[0].innerHTML.match(RegEx) console.log(Websites) //["https://www.linuxfoundation.org/cookies\","https://de.wikipedia.org\",...] It should match "https://de.wikipedia.org",because of the \ at the end, where the first escapes the other. But when I…

VIEW QUESTION

Javascript regex expression for underscore

I have a input field in GUI where user enters a text in textbox and clicks Save. I have to validate that text/string for below pattern. String: "--cpuname=some_text" // Invalid string, underscore not allowed String: "--cpuname=$(some_text)" // Valid string String:…

VIEW QUESTION

Problem with HTML/CSS/JS Form. Not working properly

Here is my code: https://codepen.io/raakh/pen/wvRqRGX 'use strict'; $(function() { $("input[type='password'][data-eye]").each(function(i) { var $this = $(this), id = 'eye-password-' + i, el = $('#' + id); $this.wrap($("<div/>", { style: 'position:relative', id: id })); $this.css({ paddingRight: 60 }); $this.after($("<div/>", { html: 'Show',…

VIEW QUESTION
Back To Top
Search