简体   繁体   English

如何在 Python 中使用正则表达式获取特定字符

[英]How to get specific characters using Regular Expression in Python

I got a string with email format, like我得到了一个 email 格式的字符串,比如

james@gmail001.com

How could I get the substring 001 ?我怎样才能得到 substring 001 Even more, how to using a function to return a email with cumulative 001 ?更重要的是,如何使用 function 来返回累积001的 email ?

Like each execution of the function and return different results like james@gmail001.com james@gmail002.com james@gmail003.com Like each execution of the function and return different results like james@gmail001.com james@gmail002.com james@gmail003.com

Thanks~谢谢~

I got a string with email format, like我得到了一个 email 格式的字符串,比如

james@gmail001.com

How could I get the substring 001 ?我怎样才能得到 substring 001 Even more, how to using a function to return a email with cumulative 001 ?更重要的是,如何使用 function 来返回累积001的 email ?

Like each execution of the function and return different results like james@gmail001.com james@gmail002.com james@gmail003.com Like each execution of the function and return different results like james@gmail001.com james@gmail002.com james@gmail003.com

Thanks~谢谢~

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python正则表达式特定字符,任意组合 - python regular expression specific characters, any combination 如何使用正则表达式python删除两个字符之间的字符串 - How to remove strings between two characters using regular expression python 如何在Python中使用正则表达式删除具有特殊字符串的字符? - How to remove characters with special strings using regular expression in Python? 如何使用正则表达式获取包含空格和字符的文本? - How to get text with both spaces and characters using a regular expression? 如何在python中使用正则表达式在特定单词之前获取特定模式的所有日期或关键字? - How do I get all the dates or keywords of particular patterns before specific word using regular expression in python? 如何使用正则表达式搜索字符串以查找包含字母,特殊字符(如-,())的字符串(使用python) - How to search string using regular expression for string contains characters alphabets and special characters like -, () using python 如何使用正则表达式用 * 替换所有字符 - How to replace all the characters with * using Regular Expression 在 python 中使用正则表达式替换特定模式 - replace specific pattern by using regular expression in python 使用正则表达式需要删除特定的特殊字符 - using Regular expression need to remove specific special characters 如何使用正则表达式去除 Python 中带有特殊字符的单词? - How to get rid of words with special characters in Python using regular expressions?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM