skip to Main Content

Php – regex just take last value

my problem is when regex get any value it just take last correct one input Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; SAMSUNG; GT-I8750) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.15063 output i get Android what real output i want…

VIEW QUESTION

Php – Perl match string containes dot too

I need to match a string which contains dot (.) and no dot. Here are the sample patterns: res:shanghai:45610 res:chicago.usa:57450 Regex I'm using: res:[w]{4,15}:[1-9][0-9]* It matches only res:shanghai:45610, but it should match both. Since the second pattern contains a dot…

VIEW QUESTION

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
Back To Top
Search