-
Notifications
You must be signed in to change notification settings - Fork 90
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
XML string array errors feedback #2357
Conversation
string rp = "[^*?<>\\|:\";,\\s]+\\s*";//"[^*?\\<\\>\\|:\\",\\s]+\\s*"; | ||
|
||
// Regex to match a path: a string that does not contain any space nor the characters *?<>|:", | ||
string rpe = "[^*?<>\\|:\";,\\s]*\\s*";//"[^*\\?<\\>\\|:\\",\\s]*\\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.
could be static constexpr auto
instead of string ?
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.
I'm afraid we cannot because of r1 and r2s need string operations. We would need string_view here.
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.
Great, thx @MelReyCG
@cssherman Do you think there are any implications with those regex in our global process (python validation or anything else)?
string rs = "[^,\\{\\}]*"; | ||
// Regex to match a string that can't be empty and does not contain any whitespaces nor the characters ,{} | ||
// TODO c++17: Move to static constexpr std::string_view | ||
string rs = "[^,\\{\\}\\s]+\\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.
Do you need to take action with potential initial spaces (like toto
) or is it OK?
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.
This pattern will be permissive of spaces at the end of the string, but not at the beginning, which should be fine, right?
"hello": match
"hello world": no match
"hello, world": no match
" hello": no match
"hello ": match
This PR aims to improve the error messages from XML string array in a more user-friendly way:
LvArray::input::stringToArray()
is needed (LvArray PR #280),This PR solves the case 1 of issue #2320.
LvArray PR #280