#include <iostream>
#include <regex>
using namespace std;

int main() {
	regex re("(^|[^_[:alnum:]])(the|a)($|[^_[:alnum:]])", regex_constants::icase);
	
	if(regex_search("the test", re))
		cout << "#1 matches!\n";

	if(regex_search("A TEST", re))
		cout << "#2 matches!\n";

	if(regex_search("wat?", re))
		cout << "#3 matches!\n";
}