Explorar o código

refactor(StringUtils.java):修复正则表达式中缺少 + 的问题

HCL %!s(int64=6) %!d(string=hai) anos
pai
achega
c2019dc3ed

+ 1 - 1
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/toolkit/StringUtils.java

@@ -259,7 +259,7 @@ public class StringUtils {
     /**
      * MP 内定义的 SQL 占位符表达式,匹配诸如 {0},{1},{2} ... 的形式
      */
-    public static Pattern MP_SQL_PLACE_HOLDER = Pattern.compile("[{](?<idx>\\d)}");
+    public static Pattern MP_SQL_PLACE_HOLDER = Pattern.compile("[{](?<idx>\\d+)}");
 
     /**
      * 替换 SQL 语句中的占位符,例如输入 SELECT * FROM test WHERE id = {0} AND name = {1} 会被替换为