Server Side Programming Articles

Page 645 of 2109

How not to match a character after repetition in Python Regex?

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 24-Mar-2026 524 Views

Regular expressions (regex) are powerful tools in Python for pattern matching and text processing. Sometimes you need to match a pattern but exclude cases where specific characters follow after repetition. This is achieved using lookahead assertions that check what comes next without including it in the match. Understanding re.findall() Function The re.findall() function searches for all occurrences of a pattern in a string and returns them as a list. It takes two main parameters: the pattern to search for and the string to search in. Syntax import re re.findall(pattern, string) Using Positive ...

Read More

How to match a single character in python using Regular Expression?

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 24-Mar-2026 2K+ Views

A single character can be matched in Python using a regular expression. A regular expression is a sequence of characters that helps you find a string or a set of strings using a search pattern. Regular expressions are also known as RegEx. Python provides the re module that is used to work with regular expressions. The Dot (.) Metacharacter The dot . is a special metacharacter in regular expressions that matches any single character except newline. It's the most common way to match a single character in a pattern. Using findall() Function The findall() function searches ...

Read More

How to match any non-digit character in Python using Regular Expression?

Pranav Indukuri
Pranav Indukuri
Updated on 24-Mar-2026 7K+ Views

A regular expression is a group of characters that allows you to use a search pattern to find a string or a set of strings. RegEx is another name for regular expressions. The re module in Python is used to work with regular expressions. In this article, we learn how to extract non-digit characters in Python using regular expressions. We use \D+ regular expression in Python to get non-digit characters from a string. Where, \D returns a match that does not contain digits. + implies one or more ...

Read More

How to match any one uppercase character in python using Regular Expression?

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 24-Mar-2026 2K+ Views

A regular expression (regex) is a pattern-matching tool that helps find specific characters or patterns in strings. In Python, the re module provides regex functionality. To match uppercase characters, you can use character classes like [A-Z] or specific character sets. Basic Regex Pattern for Uppercase Characters The pattern [A-Z] matches any single uppercase letter from A to Z. For specific uppercase characters like vowels, use [AEIOU]. import re string = 'TutoriAls PoInt Is A Great PlatfOrm to LEarn' uppercase_vowels = re.findall(r'[AEIOU]', string) print("Uppercase vowels found:", uppercase_vowels) Uppercase vowels found: ['A', 'I', 'I', ...

Read More

How to match any one lowercase vowel in python using Regular Expression?

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 24-Mar-2026 2K+ Views

In this article, you will learn how to match any single lowercase vowel (a, e, i, o, u) using Python regular expressions. We will explore different approaches using Python's re module to find and manipulate vowels in strings. Approaches to Match Lowercase Vowels There are two main ways to match any lowercase vowel in Python: Using the General Method Using Regular Expressions ...

Read More

How to specify repetitions Regex in Python?

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 24-Mar-2026 2K+ Views

A regular expression is a series of characters that allows you to match strings using search patterns. In Python, the re module is used to work with regular expressions. Repetition quantifiers in regex specify how many times a character or pattern should appear. Python regex supports several repetition operators that make pattern matching flexible and powerful. Types of Repetition Quantifiers Regex provides several special characters to specify repetitions − Asterisk (*): Matches zero or more occurrences of the preceding element. ...

Read More

How to match pattern over multiple lines in Python?

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 24-Mar-2026 15K+ Views

Learning Python's Regular Expressions (Regex) may require you to match text that spans multiple lines. This commonly occurs when reading information from files or scraping data from websites. This article demonstrates how to match patterns across multiple lines using Python's re module with special flags like re.DOTALL and re.MULTILINE. Understanding Multi-line Pattern Matching By default, the dot metacharacter . in regular expressions matches any character except newline characters. To match patterns that span multiple lines, Python's re module provides special flags that modify this behavior ? re.DOTALL: Makes . match any ...

Read More

How to match at the end of string in python using Regular Expression?

Pranav Indukuri
Pranav Indukuri
Updated on 24-Mar-2026 15K+ Views

A regular expression in Python is a set of characters that allows you to use a search pattern to find a string or a group of strings. These are used within Python using the re package. To match at the end of string in Python using regular expressions, we use the $ metacharacter which anchors the pattern to the end of the string. Understanding the Pattern The common pattern to match word characters at the end of a string is: \w+$ Here: ...

Read More

How to match at the beginning of string in python using Regular Expression?

Pranav Indukuri
Pranav Indukuri
Updated on 24-Mar-2026 13K+ Views

A regular expression in Python is a group of characters that allows you to use a search pattern to find a string or set of strings. RegEx is a term for regular expressions. To work with regular expressions in Python, use the re package. Understanding String Matching in Python String matching is a basic Python method that allows you to look for and find patterns in a given text. The match() function, a component of the re (regular expression) package, is one of the widely used methods for this purpose. Use the match() method to determine whether ...

Read More

How do you split a list into evenly sized chunks in Python?

Pranav Indukuri
Pranav Indukuri
Updated on 24-Mar-2026 3K+ Views

Sometimes it is necessary to divide a lengthy list into smaller and easy-to-read data. For example, if you wish to arrange a list of items in groups, it can be helpful to break it into small parts. This is useful for tasks like grouping data for analysis or showing items in a user interface. Python provides various simple methods to do this. In order to work with smaller data sets without losing any information, this article will show you how to split a list into uniformly sized chunks. What is List? List is one of the frequently ...

Read More
Showing 6441–6450 of 21,090 articles
« Prev 1 643 644 645 646 647 2109 Next »
Advertisements