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: