# Search for a regexp pattern, literal '-foo'
# Search case sensitive (default search)
# Search case insensitive, ignore case
# Search for files in the current directory and all subdirectories
rg -lU --multiline-dotall 'foo.*bar|bar.*foo'
# for files containing the string "foo" and "bar"
# -l : List files that contain a match (don't print the matching lines)
# regex : when foo is before bar or reverse
# List files with case insensitive search
rg -li 'string_to_search_for'
# For word in specified files
rg -w word file1 file2 file3
rg "word" *volunteer*.org
# Check pattern in specific path, files
# Search all files including hidden files in current directory and subdirectories
# search for apple, banana and/or cherry in any order in
# current directory's files
rg -e --pcre2 '^(?=.*apple)(?=.*banana)(?=.*cherry).*' .