我试图找到调用函数名称的类名.
例如,假设我有:
class foo1(object):
bar1()
class foo2(object):
bar2()
class foo3(object):
bar3()
Run Code Online (Sandbox Code Playgroud)
如果我正在搜索bar2()我想收到:
class foo2(object):
bar2()
Run Code Online (Sandbox Code Playgroud)
我试过正则表达式class[\s\S]*bar2\(\)(?!class)的想法是,我会对另一个类的外观负面预测.不幸的是,[\ s\S]似乎已经匹配所有内容:https://regex101.com/r/kZ7eE5/1
有没有办法匹配,如果"class"只出现一次匹配所有其他字符(包括新行和制表符)?
也可以接受不需要正则表达式的替代方案.
我在SublimeText3中为SublimeLinter设置用户设置有困难.我在这里查了一下:http://www.sublimelinter.com/en/latest/settings.html
我尝试设置我的用户设置,并将"max-line-length"设置为80(默认值为100):
{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "background",
"linters": {
"pylint": {
"@disable": false,
"args": [],
"disable": "",
"enable": "",
"excludes": [],
"max-line-length": 80,
"paths": [],
"rcfile": "",
"show-codes": false
}
},
"mark_style": "outline",
"no_column_highlights_line": true,
"passive_warnings": false,
"paths": {
"linux": [],
"osx": [],
"windows": []
},
"python_paths": {
"linux": [],
"osx": [],
"windows": []
},
"rc_search_limit": 3,
"shell_timeout": 10,
"show_errors_on_save": false,
"show_marks_in_minimap": true,
"syntax_map": {
"html (django)": …Run Code Online (Sandbox Code Playgroud)