You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"string contains string" actually uses Parse.Query's .matches(str,'i') specifier, which is not documented and can cause problems because various punctuation has special meaning in regexps. However, as regexps are also very useful, it would be best to keep this feature while renaming it "matches" or "matches regexp" or "matches pattern" or "regexp" or "pattern", while also have a separate choice called "contains" or "contains substring", which would match a regexp produced by :
function escapeRegex(s:string):string {
return s.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
}
Steps to reproduce
Filter a string field with a "string contains string" clause (in any version of Dashboard in which it still works, e.g. 4.0.0) ; search using a . in place of any specific character, which will find your items anyway ; then try searching for ( in a string column that has that character : searching for \( finds those items even though no \ is in that column, and searching for literally ( finds 0 results.
Actual Outcome
"string contains string" searches for regexp.
Expected Outcome
"string contains string" would search for a substring, another option would search for provided regexp.
🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
New Issue Checklist
Issue Description
"string contains string" actually uses Parse.Query's
.matches(str,'i')
specifier, which is not documented and can cause problems because various punctuation has special meaning in regexps. However, as regexps are also very useful, it would be best to keep this feature while renaming it "matches" or "matches regexp" or "matches pattern" or "regexp" or "pattern", while also have a separate choice called "contains" or "contains substring", which would match a regexp produced by :Steps to reproduce
Filter a string field with a "string contains string" clause (in any version of Dashboard in which it still works, e.g. 4.0.0) ; search using a
.
in place of any specific character, which will find your items anyway ; then try searching for(
in a string column that has that character : searching for\(
finds those items even though no\
is in that column, and searching for literally(
finds 0 results.Actual Outcome
"string contains string" searches for regexp.
Expected Outcome
"string contains string" would search for a substring, another option would search for provided regexp.
Environment
Dashboard
Server
Database
The text was updated successfully, but these errors were encountered: