Pergunta

I am trying to create a function that will act as a case-sensitive attribute of a phrase search. In the context of the program, a user will have a text document that they can then query a phrase search, and each instance of that phrase will be highlighted in the document. This phrase search can either by case sensitive or not.

Obviously if the query is case sensitive, the search will be further restricted, whereas if it is not case sensitive, a more generalized search will be completed. Now I'm just trying to come up with the best way to approach this.

The program is in Visual C++, in Visual Studios 2012, and will be using a form component. Does C++/Visual C++ support the idea of regular expressions? Are there other ways to go about restricting the search to make it case sensitive?

Any knowledge, tips, or anything is appreciated. Thanks in advance.

Foi útil?

Solução

If you are using a "form component", then I assume that you are using C++/CLI; which means you are using .NET.

In .NET there is RegEx classes and also normal string search functions. See:

If you want to use native C++, then you can use

#include <regex>

See also:

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top