Skip to content

Commit 89d059f

Browse files
committed
Polishing.
Simplify regex. See #3911
1 parent 68af434 commit 89d059f

File tree

1 file changed

+3
-3
lines changed
  • spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query

1 file changed

+3
-3
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ public abstract class QueryUtils {
195195
// any function call including parameters within the brackets
196196
builder.append("\\w+\\s*\\([\\w\\.,\\s'=:;\\\\?]+\\)");
197197
// the potential alias
198-
builder.append("\\s+(?:as|AS)+\\s+([\\w\\.]+)");
198+
builder.append("\\s+(?:as)+\\s+([\\w\\.]+)");
199199

200-
FUNCTION_PATTERN = compile(builder.toString());
200+
FUNCTION_PATTERN = compile(builder.toString(), CASE_INSENSITIVE);
201201

202202
builder = new StringBuilder();
203203
builder.append("[^\\s\\(\\)]+"); // No white char no bracket
204204
builder.append("\\s+(?:as)+\\s+([\\w\\.]+)"); // the potential alias
205205

206-
FIELD_ALIAS_PATTERN = compile(builder.toString());
206+
FIELD_ALIAS_PATTERN = compile(builder.toString(), CASE_INSENSITIVE);
207207
}
208208

209209
/**

0 commit comments

Comments
 (0)