Here's one that might help. This regex looks for any line matching the extension you want (change the "ext" characters) and looks for capitalized words that are spaced after the extension. To avoid picking up the files that have a sentence or title case after the extension, we make sure that we seek out the ones that are all caps, allowing for a space after the first character...so someone could add
"I THINK THIS IS A GREAT FILE" and get picked up. Typing
"I Think This Is A Great File" would be skipped.
Will Match:
<filename>.ext CAPITAL LETTERS
<filename>%.ext MORE CAPITAL LETTERS
<filename>.ext I TYPE IN ALL CAPS
<filename>.ext I TYPE IN ALL CAPS I SPACE TWICE AND KEEP TYPING IN ALL CAPS
No Match:
<filename> .ext I TYPE IN ALL CAPS
<filename.ext.pleaselookatme> NO .EXT BUT I'M TYPING IN CAPS
<filename>.ext noncapital letters
<filename>.ext Title Case with Capitalization
<filename>.ext I Type in all caps
<filename>.ext I Type in all caps. space twice AND THEN START TYPING IN ALL CAPS
<filename>.ext I'm A WeAnIe AnD LiKe To AlTeRnAtE My CaSe
How to regex TWO words with CAPS
[^\s]\.(ext[\s][A-Z][\sA-Z]{3,})
Options: ^ and $ match at line breaks
Match any character that is NOT a "A whitespace character (spaces, tabs, line breaks, etc.)"
Match the character "." literally
Match the regular expression below and capture its match into backreference number 1Match the characters "ext" literally
Match a single character that is a "whitespace character" (spaces, tabs, line breaks, etc.)
Match a single character in the range between "A" and "Z"
Match a single character present in the list belowBetween 3 and unlimited times, as many times as possible, giving back as needed (greedy)
A whitespace character (spaces, tabs, line breaks, etc.)
A character in the range between "A" and "Z"