Skip to main content

Function: likeToRegex()

likeToRegex(like, isStrLit?, caseSensitive?): RegExp

Defined in: lang-sql/src/utils/string.ts:75

Converts a SQL LIKE pattern to a RegExp, mapping % to .* and _ to ..

Parameters

ParameterTypeDefault valueDescription
likestringundefined-
isStrLitbooleanfalseWhether the pattern is a string literal and requires general escape sequence processing
caseSensitivebooleantrue-

Returns

RegExp