Public Function GrepToLike( _ ByVal vPattern As Variant _ ) As Variant
GrepToLike("Washington") = "*Washington*" GrepToLike("^Washington") = "Washington*" GrepToLike("^Washington$") = "Washington" GrepToLike("\^Washington\$") = "*^Washington$*" GrepToLike("\\Washington\$") = "*\Washington$*" GrepToLike("\\Washington\\") = "*\Washington\\*" GrepToLike("Wash\ing\ton") = "*Wash\ing\ton*"See also:
EgrepOrStringsToRegexPattern Function Like Operator (Visual Basic) grep Program (UNIX) regular expressions (UNIX)vPattern: The UNIX-like regular expression which is to be converted into a corresponding LIKE operator pattern. Function returns Null if vPattern is Null or cannot be fixed up to a String.
Ignore leading backslash character and interpret next character literally.
When caret found at beginning of string: anchor to beginning of line.
Ignore trailing backslash dollar-sign characters, interpreting the dollar sign literally.
When dollar-sign found at end of string: anchor to end of line.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.