The empty regular expression An empty regular expression matches everything. The replace() method returns a modified string where the pattern is replaced. This blog post takes a look at the empty regular expression. The search() method uses an expression to search for a match, and returns the position of the match. In JavaScript, regular expressions are often used with the two string methods: search() and replace(). Quantifier Description n+ Used to match any string that contains at least one n n* Used to match any string that contains zero or more occurrences of n n? Used to matches any string that contains zero or one occurrences of n Metacharacter Description \d Used to find a digit \s Used to find a whitespace character \b Used to find a match at beginning or at the end of a word \uxxxx Used to find the Unicode character specified by the hexadecimal number xxxxx Arrays, strings, or arguments objects with a length of 0 and objects with no own enumerable properties are considered empty. Metacharacters are characters with a special meaning: ISRO CS Syllabus for Scientist/Engineer ExamĮxpressions Description Find any of the character inside the brackets Find any of the digits between the brackets 0 to 9 (x | y) Find any of the alternatives between x or y separated with |.
ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys It’s quite possible that the following is not the expected consequence of passing null to a JavaScript regular expression it certainly surprised me: It looks like extra intentional work is.