@@ -2152,6 +2152,7 @@ open class KContext(
2152
2152
/* *
2153
2153
* Check if first string contains second one.
2154
2154
* */
2155
+ @JvmName(" strContains" )
2155
2156
infix fun KExpr<KStringSort>.contains (other : KExpr <KStringSort >) = mkStringContains(this , other)
2156
2157
2157
2158
private val stringToRegexExprCache = mkAstInterner<KStringToRegexExpr >()
@@ -2170,6 +2171,16 @@ open class KContext(
2170
2171
KStringToRegexExpr (this , arg)
2171
2172
}
2172
2173
2174
+ /* *
2175
+ * Create a regular expression based on a string expression.
2176
+ * */
2177
+ fun KExpr<KStringSort>.toRegex () = mkStringToRegex(this )
2178
+
2179
+ /* *
2180
+ * Create a regular expression based on a string expression.
2181
+ * */
2182
+ fun String.toRegex () = mkStringToRegex(this .expr)
2183
+
2173
2184
private val stringInRegexExprCache = mkAstInterner<KStringInRegexExpr >()
2174
2185
2175
2186
/* *
@@ -2187,6 +2198,22 @@ open class KContext(
2187
2198
KStringInRegexExpr (this , arg0, arg1)
2188
2199
}
2189
2200
2201
+ /* *
2202
+ * Check if a string belongs to the language defined by the regular expression.
2203
+ * */
2204
+ infix fun KExpr<KStringSort>.inRegex (other : KExpr <KRegexSort >) = mkStringInRegex(this , other)
2205
+
2206
+ /* *
2207
+ * Check if a string belongs to the language defined by the regular expression.
2208
+ * */
2209
+ infix fun String.inRegex (other : KExpr <KRegexSort >) = mkStringInRegex(this .expr, other)
2210
+
2211
+ /* *
2212
+ * Check if a string belongs to the language defined by the regular expression.
2213
+ * */
2214
+ @JvmName(" regexContains" )
2215
+ infix fun KExpr<KRegexSort>.contains (other : KExpr <KStringSort >) = mkStringInRegex(other, this )
2216
+
2190
2217
private val regexLiteralCache = mkAstInterner<KRegexLiteralExpr >()
2191
2218
2192
2219
/* *
0 commit comments