A : In regular expression in python, It returns a match if the specified characters are at the beginning of the string.
Example-
re.search('AStart',"Start string") will match the pattern.
re.search('AEnd',"Start string") will not match the pattern.
program-
#import the re module
import re
#take input of string
print("Enter string")
s=input()
#check string is start with 'This'
x=re.search('AThis',s)
if x:
print("String is start with This")
else:
print("String is not start with This")
#check string is start with The
x=re.search('AThe',s)
if x:
print("String is start with The")
else:
print("String is not start with The")
Enter string
This is programming
String is start with This
String is not start with The
Enter string
The program
String is not start with This
String is start with The