Nikitasha Shrivastava has Published 70 Articles

How to capture an exception raised by a Python Regular expression?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 26-May-2025 18:15:13

1K+ Views

This article gives a guide on how to capture an exception raised by a regular expression in Python. We will also see simple example programs that show how to do this. Regular expressions are useful for matching patterns in text, but they may result in errors like incorrect syntax or ... Read More

How do I clear the regular expression cache in Python?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 26-May-2025 18:11:32

762 Views

This article talks about how you can clear the regular expression cache in Python. Regular expressions in Python are used to find patterns in text, but they also use an internal cache to store frequently used expressions for faster execution. We may sometimes need to clear this cache to free ... Read More

How to use Python Regular expression to extract URL from an HTML link?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 26-May-2025 18:04:33

3K+ Views

In this article, we are going to learn how to extract a URL from an HTML link using Python regular expressions. URL is an acronym for Uniform Resource Locator; it is used to identify the location resource on the Internet. URL consists of a domain name, path, port number, ... Read More

How to use range in Python regular expression?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 26-May-2025 18:00:53

3K+ Views

In this article, you will find out how to use the range in Python regular expressions. With the help of Python's regular expressions, you can search, match, and manipulate text efficiently. One useful feature in regex is ranges, so it helps us define sets of characters within square brackets "[ ... Read More

How to write a Python regular expression to use re.findall()?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 26-May-2025 17:51:57

478 Views

This article will explain how to write a Python regular expression to use re.findall() method. Regular expression, or regex, is used insearching and extracting patterns in text. Python provides the re module to work with regex, and re.findall() to find all matches of a pattern in a string. The re.findall() method ... Read More

How do backslashes work in Python Regular Expressions?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 26-May-2025 17:15:27

668 Views

Backslashes in Python regular expressions (regex) are used to define special sequences and escape characters. As backslashes are also used in Python strings, we need to be careful while using them. How Backslashes Work Now let us see how backslashes work in Python regular expressions - ... Read More

What is the difference between a python tuple and a dictionary?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 26-May-2025 16:58:46

18K+ Views

Python offers many built-in data structures like lists, tuples, sets, and dictionaries, which are used to store and manage data easily. In this article, we will discuss the difference between a Python tuple and a dictionary. Tuple Tuples are a data type that belongs to the sequence data type category. They are ... Read More

What is the difference between a python list and an array?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 16-May-2025 18:40:55

3K+ Views

In this article we are going to discuss about the difference between Python list and array. As you may know both of these are ways to store a collection of items like a bunch of numbers or words but they are not exactly the same. So understanding how they are ... Read More

How to declare a variable in Python without assigning a value to it?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 16-May-2025 18:36:08

11K+ Views

Python variable is a name that you give to something in your program. It basically helps you keep track of objects, which are things like numbers, words or any other data. When you assign an object to a variable, you can use that name to refer to that object later. ... Read More

What is the difference between working of append and + operator in a list in Python?

Nikitasha Shrivastava

Nikitasha Shrivastava

Updated on 16-May-2025 18:33:20

4K+ Views

In this article, we will see the differences between two common ways of adding elements to lists in Python: the append method and the "+" operator.   The append() method is used to add elements to the list by utilizing a mutator() method. The '+' operator is used to create ... Read More

Advertisements