Legal input for resource pattern

What kinds of patterns are supposed to be accepted in the compiler
resource patterns field? The initial contents look like this


Is this supposed to be a semicolon-separated list of regular
expressions? Because "?*.properties" is not a legal regular expression.

The Help says to "provider here a regular expression" and gives the example


which is legal, but seems unlikely to be correct, because it would
require a file name to have a leading "-". I've tried entering


but nothing gets copied. It looks to me like this field wants file
globbing patterns, not full-featured regular expressions, which is
unfortunate and contrary to the documentation. Which is it intended to be?



I've also observed the same issue when attempting to use a legal regex:

The following code proves that the above expression is valid for Java regular expressions:

import java.util.regex.Pattern;

public class RegexTest {
public static void main(String[] args) {
String[] all = new String[]{"foo.txt", "foo.xml", "foo.doc"};
String r = "^.+
for (String s : all) {
if (Pattern.matches(r, s)) {
System.out.format("regex %s matched %s\n", r, s);


Any chance of getting an answer to this question? It seems simple enough.


Hello Michael,

the help about the format of the compiler resource pattern used to be wrong (and still seems wrong
in the latest 7.0.3 EAP). The correct pattern syntax is not based on regular expressions, but a
semicolon-separated list of patterns with * and ? as wildcards: "* denotes any number of any
characters, ? stands for any single character":


This matches all files with the specified extensions which have at least one character before the dot.



Come on Jetbrains, let's get this fixed. We pay good money for this tool.

I did a quick search in the IDEADEV Jira for "resource pattern regex":

IDEADEV-23194 Resource patterns aren't patterns FIXED
IDEA-6493 Help text wrong for Compiler -> resource patterns FIXED

Are these REALLY fixed? (no, at least not in 7.0.2).

We want real regex expressions as advertised in the Help!



Please sign in to leave a comment.