Your Dashboard
Sign-in
Sign-up
RegularPython
  • Membership
  • RoadMaps
  • Online Tests
    • Online Test
    • Interview Questions
    • Online Store
  • Jobs
    • Student Reviews
    • Mock Interviews
    • Apply for jobs
    • Contact for help
  • Sign-in
  • Sign-up
  1. Home
  2. Python Basic Courses

regularpython@gmail.com

Image

Regular Expressions

  • Category
    Regular Python, Match, Search, Find, Findall, Replace
  • Course Menu
    • Python Introduction
    • Python Uses
    • Python Features
    • Python Operators
    • Python Data Types
    • Python Numbers
    • Python Strings
    • Python Lists
    • Python Tuples
    • Python Dictionaries
    • Python Sets
    • Python Decision Making
    • Python Loops
    • Python Exceptions
    • Python Functions
    • Python Lambda function
    • Random Numbers in Python
    • Regular Expressions
    • Python Decorators
    • Python generators

Regular Expressions

Regular expressions are the most important topic in python. These are used to find a string or character or digits in the given Data. In Web scraping and Django, this is the most powerful topic. I have a lot of web scraping and website development projects. I will explain the real power of Regular Expressions. Python provides re module for regular expressions. It has three most powerful functions,

1.Match

2.Search

3.Search and Replace

 

Characters

Description

Details

.

It finds all characters except a newline character

Click here for more details

\d

It finds all digits

0-9

Click here for more details

\D

It finds all characters except digits

Click here for more details

\s

It finds all white space characters

Space, tab, return

Click here for more details

\S

It finds all characters except white space characters

Click here for more details

\w

It finds all word characters like

a-z, A-Z, 0-9, _

Click here for more details

\W

It finds all characters  except word characters

Click here for more details

\b

It matches boundaries

Click here for more details

\B

It matches non-boundaries

Click here for more details

^

Matches beginning of the line

Click here for more details

$

Matches ending of the line

Click here for more details

[…]

It used to match a group of characters

Click here for more details

[^…]

It used to match a group of characters not mentioned in square brackets

Click here for more details

*

It matches 0 or more occurrences of the preceding expression.

Click here for more details

+

It matches 1 or more occurrences of the preceding expression.

Click here for more details

?

It matches 0 or one occurrences of the preceding expression.

Click here for more details

{x}

It matches exactly x number of occurrences of the preceding expression

Click here for more details

{a,}

It used to match x or number of occurrences of the preceding expression

Click here for more details

{a, b}

It is used to match the range

Click here for more details

a|b

It is used to match a or b

Click here for more details

()

It is used to make groups

Click here for more details

<.*>

Greedy repetition matches

Click here for more details

<.*?>

Non-greedy repetition matches

Click here for more details

RegularPython

This website helps to learn ptyhon from basics to advanced level. Everything explained with some practical examples.

  • About
  • Privacy
  • Video Courses
  • Online Test
  • Python Blog

Marthahalli, Bengalore.
regularpython@gmail.com

© Copyright 2020 RegularPython.

  • Sign-in
  • Sign-up