Skip to content

Tag Archives: python-regex

In this article, we are going to see how to check whether the given string contains only certain set of characters in Python. These defined… Read More
Prerequisite: Regular Expression in Python URL or Uniform Resource Locator consists of many information parts, such as the domain name, path, port number etc. Any… Read More
Prerequisite: Regular Expressions in Python In this article, Let’s see how to extract date from the Excel file. Suppose our Excel file looks like below… Read More
re.MatchObject.span() method returns a tuple containing starting and ending index of the matched string. If group did not contribute to the match it returns(-1,-1). Syntax:… Read More
This method returns a tuple of all matched subgroups. Syntax: re.MatchObject.groups() Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.… Read More
This method returns a dictionary with the groupname as keys and the matched string as the value for that key. Syntax: re.MatchObject.groupdict() Attention geek! Strengthen your… Read More
re.MatchObject.group() method returns the complete matched subgroup by default or a tuple of matched subgroups depending on the number of arguments Syntax: re.MatchObject.group([group]) Attention geek! Strengthen… Read More
Prerequisite: Regular Expression in Python Many of the times we need to search for a particular type of file from a list of different types… Read More
Prerequisite: Regular Expression in Python Given a string str, the task is to check if a string starts with a given substring or not using… Read More
Prerequisite: Regular Expression in Python In this article, we will see how to remove continuously repeating characters from the words of the given column of… Read More
Prerequisite: Regular Expression in Python In this article, we will see how to extract punctuation used in the specified column of the Dataframe using Regex. Attention… Read More
In this article, we are going to see re.MatchObject.start() and re.MatchObject.end() regex methods. re.MatchObject.start()  This method returns the first index of the substring matched by… Read More
Let us see how to extract IP addresses from a file using Python.  Algorithm :   Attention geek! Strengthen your foundations with the Python Programming Foundation Course… Read More
Given a URL as a character string str of size N.The task is to check if the given URL is valid or not.Examples :  Input… Read More
Prerequisites: Regular Expression in Python Given a string. The task is to count the number of Uppercase, Lowercase, special character and numeric values present in… Read More

Start Your Coding Journey Now!