mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
Optimize regex usage
This commit is contained in:
parent
8a8cf8c66c
commit
67ff1abfeb
@ -26,13 +26,13 @@ public final class Normalization {
|
||||
|
||||
// TODO simplify
|
||||
private static final Pattern FULL_OPERATION = Pattern.compile(
|
||||
"(?<![\\d\\*/\"\\?' ])" + "(\\b|\\(|\\s+)" +
|
||||
"(?<![\\d*/\"?' ])" + "(\\b|\\(|\\s+)" +
|
||||
"(" + NUMBER + WS + "[+\\-/*]" + WS + ")+" + NUMBER + WS +
|
||||
"(?![\\d\\*/\"' ])");
|
||||
"(?![\\d*/\"' ])");
|
||||
|
||||
private static final Pattern[] OPERATIONS = {
|
||||
Pattern.compile(NUMBER + WS + "(\\*|/)" + WS + NUMBER),
|
||||
Pattern.compile(NUMBER + WS + "(\\+|\\-)" + WS + NUMBER),
|
||||
Pattern.compile(NUMBER + WS + "([*/])" + WS + NUMBER),
|
||||
Pattern.compile(NUMBER + WS + "([+-])" + WS + NUMBER),
|
||||
};
|
||||
|
||||
private static String normalizeOperation(String queryString) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user