Blog

python tutorials and learn python

Created with Sketch.

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

JavaScript Regular Expression

JavaScript Regular Expression Summary: in this tutorial, you’ll learn about JavaScript regular expressions. After the tutorial, you’ll know how to use regular expressions effectively to search and replace strings. Introduction to regular expressions in JavaScript A regular expression is a string that describes a pattern e.g., email addresses and phone numbers. In JavaScript, regular expressions…
Read more

Javascript Regex

Javascript Regex Regex stands for regular expressions, which are sequences of characters that specify search patterns. In JavaScript, you’ll find regular expressions in many applications such as data validations based on patterns. This page helps you master regex in JavaScript from scratch. After the tutorials, you’ll be confident writing regular expressions and using regex functions…
Read more