Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
How to match any non-digit character in Python using Regular Expression?
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 MoreHow to match any one uppercase character in python using Regular Expression?
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 MoreHow to match any one lowercase vowel in python using Regular Expression?
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 MoreHow to specify repetitions Regex in Python?
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 MoreHow to match pattern over multiple lines in Python?
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 MoreHow to match at the end of string in python using Regular Expression?
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 MoreHow to match at the beginning of string in python using Regular Expression?
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 MoreHow do you split a list into evenly sized chunks in Python?
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 MoreHow to get first 100 characters of the string in Python?
As you may know a string is a group of letters, numbers, or symbols in Python. Sometimes we do not need the whole string. We may only want a small part of it. For example, we may want only the first 100 characters. Python makes this easy by using something called slicing. Slicing means taking a part of the string using square brackets [] with numbers inside to specify the range. In this article, we will show you how to get the first 100 characters of a string in Python. The following are the 4 different methods to accomplish ...
Read MoreHow can we convert a list of characters into a string in Python?
A list is a data structure in Python that is a mutable or changeable ordered sequence of elements. Lists are defined by having values inside square brackets [], and they are used to store multiple items in a single variable. In Python, strings are among the most widely used types. We can create them simply by enclosing characters in quotes. Converting a list of characters into a string is a common operation with several approaches ? Using join() Method The join() method is the most efficient way to convert a list into a string. It takes an ...
Read More