I am writing a program that needs to search a LARGE text document for a large collection of words. The words are all file names, with underscores in them (eg, this_file_name). I know how to open and iterate through a text document, but I’m curious whether I should use Regex to search for these names, and if so, what kind of reg. ex. sequence should I use? I’ve tried
Regex r = new Regex('?this\_file\_name');
but I get an invalid argument error every time.
It would be helpful to see a sample of the source text. but maybe this helps