🌟 Day95 of #100DaysOfPython 🌟

🌟 Day95 of #100DaysOfPython 🌟

Today, we're diving into regex in python!

Regex allows you to define search patterns for strings, making it easier to find, match, or manipulate text.

Let's take a look with the help on a example below in the below code snippet:

Article content



  1. re.search() search for the first match in the text
  2. the loop helps us to find all matches in the text
  3. match.span() prints the start and end position of the match in the form of a tuple
  4. type(match.span()) prints the type of object returned by match.span()



Stay tuned for more such demonstrations!

To view or add a comment, sign in

Others also viewed

Explore topics