expr icon indicating copy to clipboard operation
expr copied to clipboard

Support matches for bytes

Open amikai opened this issue 1 year ago • 1 comments

The matches operation currently only supports string types and uses regexp.MatchString under the hood. Is it possible to support regexp.Match when the left variable is a byte slice?

Currently, the string matches operation can support:

"123" matches "123"
a matches b
a matches "123"
"123" matches b

After adding support for byte slices, it should support the following scenarios (expr does not have a byte slice type):

a matches "123" (a is a byte slice in Go)

amikai avatar Jul 12 '24 16:07 amikai

This is a good idea. Let's add support for []byte as well.

antonmedv avatar Jul 13 '24 11:07 antonmedv