Skip to content

Commit 4d5453d

Browse files
committed
Polishing.
Simplify regex. See #3911
1 parent 185fe9b commit 4d5453d

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
@@ -202,15 +202,15 @@ public abstract class QueryUtils {
202202
// any function call including parameters within the brackets
203203
builder.append("\\w+\\s*\\([\\w\\.,\\s'=:;\\\\?]+\\)");
204204
// the potential alias
205-
builder.append("\\s+(?:as|AS)+\\s+([\\w\\.]+)");
205+
builder.append("\\s+(?:as)+\\s+([\\w\\.]+)");
206206

207-
FUNCTION_PATTERN = compile(builder.toString());
207+
FUNCTION_PATTERN = compile(builder.toString(), CASE_INSENSITIVE);
208208

209209
builder = new StringBuilder();
210210
builder.append("[^\\s\\(\\)]+"); // No white char no bracket
211211
builder.append("\\s+(?:as)+\\s+([\\w\\.]+)"); // the potential alias
212212

213-
FIELD_ALIAS_PATTERN = compile(builder.toString());
213+
FIELD_ALIAS_PATTERN = compile(builder.toString(), CASE_INSENSITIVE);
214214
}
215215

216216
/**

0 commit comments

Comments
 (0)