Usually I would expect a String.contains() method, but there doesn't seem to be one.   What is a reasonable way to check for this?...
Is there a way to retrieve the (starting) character positions inside a string of the results of a regex match() in Javascript?...
I'm looking for a fuzzy search JavaScript library to filter an array. I've tried using fuzzyset.js and fuse.js, but the results are terrible (there are demos you can try on the linked pages).  After doing some reading on Levenshtein distanc...
How can I place many pseudo selectors inside the native Javascript querySelectorAll()?  Example: I want to search for an element with an id that starts with [id^=starting]  and ends with [id$=ending]. (Couldn't find existing question so making my...
I am trying to make a small random quizz generator, first array has the questions and they are randomly displayed (when page is loaded or when page is refreshed), the second array has the answers.  Now, when the user typed an answer, if that answer i...
I'm going through the CoderByte exercises and I came across the following problem:   >Using the JavaScript language, have the function LetterChanges(str) take the str parameter being passed and modify it using the following algorithm. Replace...
The Problem:  I have an array of promises which is resolved to an array of strings. Now the test should pass if at least one of the strings matches a regular expression.  Currently, I solve it using simple string concatenation:  protractor.promise.al...
I've got a simple regular expression:  [A-z]{2}[0-9]{3})$/g inside the following:  regForm.submit(function(){   if ($.trim($('#new-usr').val()).match(/([A-z]{2}[0-9]{3})$/g)) {     alert('No');     return false;   } });   This is...
What is the cleanest way of finding the position of the first difference in any two strings in Javascript?  var a = 'in the'; var b = 'in he'; findFirstDiffPos(a, b); // 3  var c = 'in the beginning'; findFirstDiffPos(a, c); /...
I need this string:  var x = 'Hi ${name}! How are you? ${name}, you are old! ${name} share with ${other} how do u ${feel}!'   I need to know using Regex how much distinct ${ANY_THING} exists. In example above i expect 3: ${name}, ${other}, ${...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.