how to construct pattern in regular expression
How to generate a regular expression that will scan a full text file (say, sample.txt) and return开发者_StackOverflow中文版 the index of the first occurance of STRT followed by any number of spaces and then a
. That means it can be like
"STRT ."
or it can be like
"STRT ."
Try this: @"STRT\s*\."
the \s* will match any number of whitespace characters and . will match the literal period.
精彩评论