Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Python Online

import re

strList = ['31231aB', 'meaningful', '#@!$Sdas1', 'asda', '^asdasd' , '@dawa' , '15/9-16']
testStr = 'dadasadsae23sad2'
dList = ['\d', '\$', '\@', '\^']

for i in range(0,len(strList)):
    for j in range(0,len(dList)):
        if (re.search(dList[j],strList[i])):
            strList[i] = ''
            
print(strList)

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.