The --multiline option means the search spans multiple lines - I only want to match entire files that begin with my search term, so this means that ^

Finding CSV files that start with a BOM using ripgrep

submited by
Style Pass
2021-05-29 10:30:04

The --multiline option means the search spans multiple lines - I only want to match entire files that begin with my search term, so this means that ^ will match the start of the file, not the start of individual lines.

(?-u: means "turn OFF the u flag for the duration of this block" - the u flag, which is on by default, causes the Rust regex engine to interpret input as unicode. So within the rest of that (...) block we can use escaped byte sequences.

Leave a Comment