Hey Guys,
I'm looking for a way to translate a pattern for the LIKE keyword in SQL to a regular expression.
To help illustrate what I mean... I imagine a method stub would look something like this.
RegularExpression SqlLikeToRegex(string SqlLikePattern) {
// some code that translates a sql like pattern to a regularexpression
}
The reason being a program I'm rewritting a program that made use of the like keyword in a way that allowed users to create masks to match strings. Over the years all of the users grew to love this and know it well, so I really want to (read... have to) make it work the same.
My problem is the new app uses a disconnected data model, so I can't just perform a LIKE against the database as the disconnected data most likely has a different state than the data on the server. I would like to avoid pushing the data back to the server to perform this operation.
Ideas?? Resources?? Maybe someone has already done this?? Help plz!!
I'm looking for a way to translate a pattern for the LIKE keyword in SQL to a regular expression.
To help illustrate what I mean... I imagine a method stub would look something like this.
RegularExpression SqlLikeToRegex(string SqlLikePattern) {
// some code that translates a sql like pattern to a regularexpression
}
The reason being a program I'm rewritting a program that made use of the like keyword in a way that allowed users to create masks to match strings. Over the years all of the users grew to love this and know it well, so I really want to (read... have to) make it work the same.
My problem is the new app uses a disconnected data model, so I can't just perform a LIKE against the database as the disconnected data most likely has a different state than the data on the server. I would like to avoid pushing the data back to the server to perform this operation.
Ideas?? Resources?? Maybe someone has already done this?? Help plz!!