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

正则匹配 #83

Open
liujuanjuan1984 opened this issue Nov 27, 2019 · 5 comments
Open

正则匹配 #83

liujuanjuan1984 opened this issue Nov 27, 2019 · 5 comments

Comments

@liujuanjuan1984
Copy link
Owner

环境:
win10 + vscode + 内置搜索

对象:
ipynb文件

场景:
新书内容编辑

@liujuanjuan1984
Copy link
Owner Author

需求1:

http 类链接,改为[]() 语法,使之可点击访问,也避免 非url 的文本被代入

@liujuanjuan1984
Copy link
Owner Author

liujuanjuan1984 commented Nov 27, 2019

任意 ascii [\\x00-\\x7F]

任意 非 ascii [^\\x00-\\x7F]

url http[:s]+//[\\x00-\\x7F\.~/]*[^\\x00-\\x7F]

@liujuanjuan1984
Copy link
Owner Author

liujuanjuan1984 commented Nov 27, 2019

任意中文紧跟着数字
[\u4e00-\u9fa5]+\d+

@liujuanjuan1984
Copy link
Owner Author

image

一个很好的文章链接

https://www.cnblogs.com/jameBo/p/10559864.html

想要匹配中文和英文数字混用的情况,使之增加空格
左中文:
搜索 ([\u4e00-\u9fa5]+)(\w+)
替换 $1 $2

右中文
搜索 (\w+)([\u4e00-\u9fa5]+)
替换 $1 $2

@liujuanjuan1984
Copy link
Owner Author

(\w+)\\n",[ \f\n\r\t\v]+"(\w+)

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

1 participant