【Python】笔记

这里写自定义目录标题

#Regular Expression

目前在修Programming for everybody 的第三个系列课程,也是第一次涉及到Python的库,感觉单靠记忆略有难度,故于此留下点滴记录。

特殊字符:
‘^’ start with
‘\S’ non-blank character
‘+’ at least one
'’ zero or more than one
‘[^ character]’ everything but this character
‘’ make the special characters such as ^,
,$, etc the real character of what it should be
‘[1-9.]’ all numbers of this string(return a list of string of number such as [‘1’,‘2’]) (note dot here means real number)
‘[AEIOU]’ all upper vowel charact

在这里插入图片描述

·re.method()
re.search():useage: re.search(’…’,x) // success return true ;failed return false

	re.findall(): useage: re.findall('^From: (\s+@\s+)',x)  //translation: match string start with 'From:', and extract string as '\s+@\s+''. 
						tips:parentheses here just show which part to extract
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值