Skip to content

fix: handle special characters in column name in filter #498

@github-actions

Description

@github-actions

Problem

When using filter, if the column specified has special character in them then the validation regex does not pass it as of now. We need to fix the regex, such that special named columns can also be parsed.

// TODO: handle special characters in column name in filter
// example: a>b, a>=b, a<b, a<=b, a!=b, a=b, a="b", a=\"b\" and c>d, a="b" or c>d
var FilterRegex = regexp.MustCompile(`^(\w+)\s*(>=|<=|!=|>|<|=)\s*(\"[^\"]*\"|\d*\.?\d+|\w+)\s*(?:(and|or)\s*(\w+)\s*(>=|<=|!=|>|<|=)\s*(\"[^\"]*\"|\d*\.?\d+|\w+))?\s*$`)
matches := FilterRegex.FindStringSubmatch(filter)


This issue was generated by todo-issue based on a TODO comment in 2b4a2de. It's been assigned to @vikash390 because they committed the code.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions