Fixed the ? wildcard.
@@ -66,15 +66,15 @@ switch(cleanerArgs[0]) {
* Forming the regex:
* "\Q" starts an explicit quote (which includes all reserved characters as well)
* "\E" ends an explicit quote
- * "\w*" is equivalent to "*" - it selects anything that has the same characters as before or
- * after the asterisk
- * "\w*" is equivalent to "?" - it selects anything that has the rest of the pattern but any
+ * "\w*" is equivalent to "*" - it selects anything that has the same characters
+ * (in the range of a-z, A-Z or 1-9) as before and after the asterisk
+ * "." is equivalent to "?" - it selects anything that has the rest of the pattern but any
* character in the "?" symbol's position
* So, "\Q<INPUT_PART1>\E\w*\Q\<INPUT_PART1>E", selects anything that starts with INPUT_PART1
* and ends with INPUT_PART2 - This regex expression is equivalent to the input argument
* "INPUT_PART1*INPUT_PART2"
*/
- String regex = ("\\Q" + arg.replace("*", "\\E\\w*\\Q").replace("?", "\\E\\w+\\Q") + "\\E")
+ String regex = ("\\Q" + arg.replace("*", "\\E\\w*\\Q").replace("?", "\\E.\\Q") + "\\E")
if (module.matches(regex)) {
selectedModules.add(module)
}
