Category: JavaScript Tutorial

python tutorials and learn python

Created with Sketch.

Lookahead

Lookahead Summary: in this tutorial, you’ll learn about JavaScript regex lookahead to match X but if only it is followed by Y. Introduction to JavaScript regex lookahead In regular expressions, a lookahead allows you to match X but only if it is followed by Y. Here’s the syntax of the lookahead: X(?=Y) Code language: JavaScript…
Read more

Regex Alternation

Regex Alternation Summary: in this tutorial, you’ll learn about JavaScript regex alternation, which is the “OR” operator in regular expressions. Introduction to the regex alternation Regex uses the pipe operator (|) to represent an alternation, which is like the logical OR operator in regular expressions. The alternation allows you to match either A or B:…
Read more

Backreferences

Backreferences Summary: in this tutorial, you’ll learn about JavaScript regex backreferences and how to apply them effectively. Introduction to JavaScript regex backreferences Backreferences allow you to reference the capturing groups in the regular expressions. Technically speaking, backreferences are like variables in regular expressions. Here’s the syntax of a backreference: \N Code language: Python (python) In…
Read more

Regular Expression: Sets and Ranges

Regular Expression: Sets and Ranges Summary: in this tutorial, you will learn about the sets and ranges in regular expressions. Sets The square brackets search for any character in a set. For example, [aeiou] matches any of the five characters: ‘a’, ‘e’, ‘i’, ‘o’ and ‘u’. The […] is called a set. For example, the…
Read more

Regular Expression: Non-Greedy Quantifiers

Regular Expression: Non-Greedy Quantifiers Summary: in this tutorial, you’ll learn how to use non-greedy quantifiers to match their preceding elements as few as possible. Introduction to JavaScript regex non-greedy (or lazy) quantifiers In regular expressions, quantifiers allow you to match their preceding elements with specified numbers of times. By default, quantifiers use the greedy mode…
Read more

Regular Expression: Non-Greedy Quantifiers

Regular Expression: Non-Greedy Quantifiers Summary: in this tutorial, you’ll learn how to use non-greedy quantifiers to match their preceding elements as few as possible. Introduction to JavaScript regex non-greedy (or lazy) quantifiers In regular expressions, quantifiers allow you to match their preceding elements with specified numbers of times. By default, quantifiers use the greedy mode…
Read more

Regular Expression: Quantifiers

Regular Expression: Quantifiers Summary: in this tutorial, you’ll learn how to use quantifiers to match a number of instances of a character, group, or character class in a string. Quantifiers match a number of instances of a character, group, or character class in a string. Quantity Exact count {n} A number in curly braces {n}is…
Read more

Regular Expression: Word Boundaries

Regular Expression: Word Boundaries Summary: in this tutorial, you’ll learn how to use the word boundary in regular expressions. The (\b) is an anchor like the caret (^) and the dollar sign ($). It matches a position that is called a “word boundary”. The word boundary match is zero-length. The following three positions are qualified…
Read more

Regular Expression: Anchors

Regular Expression: Anchors Summary: in this tutorial, you’ll learn about regular expression anchors that allow you to match a position before or after characters. Anchors have special meaning in regular expressions. They do not match any character. Instead, they match a position before or after characters:  ^ – The caret anchor matches the beginning of…
Read more

Regular Expression: Character Classes

Regular Expression: Character Classes Summary: in this tutorial, you’ll learn about character classes in regular expressions to match a set of characters including digits, whitespace, and word characters. Introduction to the character classes A character class allows you to match any symbol from a certain character set. A character class is also called a character…
Read more