REGULAR EXPRESSION using PYTHON
-january 4.1.2020
CONCEPT:
To get the year from the e-mail id using \d+.
SYMBOL:
\d - digit(match digit)
\w - specific alphanumeric
\s - space(count the no of space
\. - each single characters
+ - 1..............infinity
* - 0.............infinity
? - (+91)(Eg: 91 is optional number may be)
INPUT:
Given Email Id (2000lathaammu2020@gmail.com)
OUTPUT:
if your input email id is 2000lathaammu2020@gmail.com then your output is ['2000','2020']
PROGRAM:
for PYTHON..........
import re
s="2000lathaammu2020@gmail.com"
re.findall('\d+',s)
...................................................................................................................................................................
-january 4.1.2020
CONCEPT:
To get the year from the e-mail id using \d+.
SYMBOL:
\d - digit(match digit)
\w - specific alphanumeric
\s - space(count the no of space
\. - each single characters
+ - 1..............infinity
* - 0.............infinity
? - (+91)(Eg: 91 is optional number may be)
INPUT:
Given Email Id (2000lathaammu2020@gmail.com)
OUTPUT:
if your input email id is 2000lathaammu2020@gmail.com then your output is ['2000','2020']
PROGRAM:
for PYTHON..........
import re
s="2000lathaammu2020@gmail.com"
re.findall('\d+',s)
...................................................................................................................................................................
No comments:
Post a Comment