HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Python has a built-in package called re
, which can be used to work with
Regular Expressions.
Import the re
module:
import re
When you have imported the re
module, you
can start using regular expressions:
Search the string to see if it starts with "The" and ends with "Spain":
import
re
txt = "The rain in Spain"
x = re.search("^The.*Spain$", txt)