13

For example, how do you set the i flag to perform a case insensitive match? Is it even possible?

In code I would usually do something like /needle/i

The Visual Studio Code documentation only makes a passing reference to the fact it uses the ripgrep regex engine. The docs there didn't help me either.

0

1 Answer 1

8

In the find panels, selecting the "Match Case" option turns a case-insensitive search into a case-sensitive search. So if the option is not selected, the search is case-insensitive.

find panel: match case

Sign up to request clarification or add additional context in comments.

3 Comments

I suppose behind the scenes this sets the regex i flag. Was curious if there was a more general way of applying regex flags though. Looks like they've provided a slightly simplified regex interface. Probably with good reason.
One of the first links in ripgrep's README is a link to the docs for its regex syntax. Among them are examples for applying flags within a regex. e.g., (?i)foo will match foo case insensitively. (This is fairly standard syntax for regexes, and is supported by both Perl and Python.)
Unfortunately, that syntax does not work in vscode. I do have the pcre option enabled. (?I)anything errors.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.