Finding ++ in Regular Expression

finding thesaurus
findings in a sentence
finding nemo
finding or findings
finding movie
any findings
how to pronounce finding
clinical findings synonym

I want to find ++ or -- or // or ** sign in in string can anyone help me?

var str = document.getElementById('screen').innerHTML;
var res = str.substring(0, str.length);
var patt1 = ++,--,//,**;
var result = str.match(patt1);  
if (result)
{
    alert("you cant do this :l");
    document.getElementById('screen').innerHTML='';
}

Define your pattern like this:

var patt1 = /\+\+|--|\/\/|\*\*/;

Now it should do what you want.

More info about regular expressions: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

Finding Synonyms, Finding Antonyms, small articles or tools used in making garments, shoes, or jewelry. A conclusion reached after examination or investigation: the finding of a grand jury; a coroner's findings.


This finds doubles of the characters by a backreference:

/([+\/*-])\1/g

[from q. comments]: i know this but when i type var patt1 = /[++]/i; code find + and ++

[++] means one arbitrary of the characters. Normally + is the qantifier "1 or more" and needs to be escaped by a leading backslash when it should be a literal, except in brackets where it does not have any special meaning.

Characters that do need to be escaped in character classes are e.g. the escape character itself (backslash), the expression delimimiter (slash), the closing bracket and the range operator (dash/minus), the latter except at the end of the character class as in my code example.

A character class [] matches one character. A quantifier, e.g. [abc]{2} would match "aa", "bb", but "ab" as well.

You can use a backreference to a match in parentheses:

/(abc)\1

Here the \1 refers to the first parentheses (abc). The entire expression would match "abcabc".

To clarify again: We could use a quantifier on the backreference:

/([+\/*-])\1{9}/g

This matches exactly 10 equal characters out of the class, the subpattern itself and 9 backreferences more.

/.../g finds all occurrences due to the modifier global (g).

test-case on regextester.com

Finding, Examples of finding in a Sentence. She published her findings in a medical journal. The evidence supported a finding of unfair bias. Recent  noun the act of a person or thing that finds; discovery. Often findings. something that is found or ascertained. Law. a decision or verdict after judicial inquiry.


You can use:

/\+\+|--|\/\/|\*\*/

as your expression.

Here I have escaped the special characters by using a backslash before each (\).

I've also used .test(str) on the regular expression as all you need is a boolean (true/false) result.

See working example below:

var str = document.getElementById('screen').innerHTML;
var res = str.substring(0, str.length);

var patt1 = /\+\+|--|\/\/|\*\*/;
var result = patt1.test(res);

if (result) {
  alert("you cant do this :l");
  document.getElementById('screen').innerHTML = '';
}
<div id="screen">
  This is some++ text
</div>

finding, 42 synonyms of finding from the Merriam-Webster Thesaurus, plus 45 related words, definitions, and antonyms. Find another word for finding. a piece of information that is discovered during an official examination of a problem, situation, or object: The report's finding on the decrease in violent crime supports the police chief's claims.


Try this:-

As

  1. n+:- Matches any string that contains at least one n

  2. n* Matches any string that contains zero or more occurrences of n

We need to use backslash before this special characters.

 var str = document.getElementById('screen').innerHTML;
    var res = str.substring(0, str.length);
    var patt1 = /\+\+|--|\/\/|\*\*/;
    var result = str.match(patt1);  
    if (result)
        {
        alert("you cant do this :l");
        document.getElementById('screen').innerHTML='';
        }
<div id="screen">2121++</div>

Finding Synonyms, Finding Antonyms, findings, tools, materials, etc., used by artisans. QUIZZES. DO YOU KNOW THESE 9TH GRADE VOCABULARY WORDS? Test your vocab skills and see if you  Synonyms & Antonyms of finding (Entry 1 of 2) 1 a decision made by a court or tribunal regarding a case it has heard the evidence supported a finding of unfair bias, and the court entered judgment for the plaintiff


Findings, finding meaning: 1. a piece of information that is discovered during an official examination of a problem…. Learn more. noun the act of a person or thing that finds; discovery. Often findings. something that is found or ascertained. Law. a decision or verdict after judicial inquiry.


Use findings in a sentence, A finding is a discovery, especially by scholars or scientists. Finding is the act of researching or analyzing something. If the dog digs up the hamster grave in the  Synonyms for finding at Thesaurus.com with free online thesaurus, antonyms, and definitions. Find descriptive alternatives for finding.


Tip #4: Search for Similar Words, 3findingsNorth American Small articles or tools used in making garments, shoes, or jewellery. Pronunciation. finding. /ˈfʌɪndɪŋ/. n. the determination of a factual question vital (contributing) to a decision in a case by the trier of fact (jury or judge sitting without a jury) after a trial of a lawsuit, often referred to as findings of fact. A finding of fact is distinguished from a conclusion of law which is determined by the judge as the sole legal expert.