-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
feat: Update tool.py 支持所有 JSON 形式和普通文字 #648
base: main
Are you sure you want to change the base?
Conversation
增强后的正则表达式以支持所有 JSON 形式和普通文字 Enhanced regular expression to support all JSON formats and plain text https://onecompiler.com/python/42fcba277
re_param_code = r'\s*([\w ]+):\s*("(?:\\"[^,]|\\"|\\|[^\"])+"|[^,]*)(?:,|$)' | ||
# 增强后的正则表达式以支持所有 JSON 形式和普通文字 | ||
# Enhanced regular expression to support all JSON formats and plain text | ||
re_param_code = r'\s*(\w[\w \-/]+):\s*({.*?}|\[.*?\]|"(?:\\.|[^\\"])*"|[^,]*)(?:,|$)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因為原版也有這個BUG 無法完整分析
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
減少一行代碼 但閱讀性差了一點
sd-webui-infinite-image-browsing/scripts/iib/tool.py Lines 350 to 357 in 91376c2
原版本來就是把這些值用json處理的 |
增强后的正则表达式以支持所有 JSON 形式和普通文字
Enhanced regular expression to support all JSON formats and plain text
https://onecompiler.com/python/42fcba277