Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

匹配多个同样的模式串 #8

Open
Gavingx opened this issue Jun 19, 2020 · 1 comment
Open

匹配多个同样的模式串 #8

Gavingx opened this issue Jun 19, 2020 · 1 comment

Comments

@Gavingx
Copy link

Gavingx commented Jun 19, 2020

假如有这么个字符串:2020年8月15日我来到了北京,想起了2013年的事情,现在已经是9时43分了。用正则怎么抽出["2020年8月15日", "2013年”, "9时43分”]? 即:我想抽出某个字符串中的日期和时间,但是不期望得到["2020年", "8月", "15日", "2013年", "9时", "43分"]?

@2531
Copy link

2531 commented Mar 28, 2021

(\d{1,4}[月日年时分秒]){1,3}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants