XSV Search Regex

Filed under: programming

I was looking up the syntax for specifying regex patterns with the XSV command-line toolkit for working with CSV files. The underlying language is Rust, the search feature uses the RegexBuilder module for it’s search feature. Kept digging and found myself looking through the Rust documentation. Found the specific regex syntax.

With that regex, you can write patterns to find specific substrings, for example:

xsv search -s 3 'foo.*' sample.csv

will search the 3rd column for values matching substring that starts with foo.