-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wildcards/Regular Expressions in WHERE clause - SIMILAR TO predicate [CORE769] #1151
Comments
Modified by: @pcisarissuetype: New Feature [ 2 ] => Improvement [ 4 ] assignee: Dmitry Yemanov [ dimitr ] SF_ID: 807985 => |
Modified by: @pcisarassignee: Dmitry Yemanov [ dimitr ] => |
Commented by: @asfernandes Will be done with the SQL standard SIMILAR predicate. |
Modified by: @dyemanovFix Version: 2.5 Alpha 1 [ 10224 ] |
Commented by: Dimitrios Chr. Ioannidis (dchri) Use of the new Target Final Release Version field. |
Modified by: Dimitrios Chr. Ioannidis (dchri)Target Final Release Version: 2.5.0 [ 10221 ] |
Modified by: @asfernandesissuetype: Improvement [ 4 ] => New Feature [ 2 ] summary: Wildcards/Regular Expressions in WHERE clause => Wildcards/Regular Expressions in WHERE clause - SIMILAR TO predicate |
Commented by: @asfernandes Implemented SIMILAR TO predicate. |
Modified by: @pcisarWorkflow: jira [ 10793 ] => Firebird [ 15192 ] |
Modified by: @asfernandesWiki Page: https://wiki.firebirdsql.org/wiki/index.php?page=SIMILAR+TO |
Modified by: @pmakowskistatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: No test Test Details: See test for CORE2006 |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: No test => Done successfully Test Details: See test for CORE2006 => See also test for CORE2006 |
Submitted by: @pcisar
Is related to QA292
SFID: 807985#
Submitted By: pcisar
A RegEx could be compiled and hence run faster against
a table.
----------------------
User: peter_jacobi
Logged In: YES
user_id=845149
Responding to rdifalco comments:
Your query can be formulated in standard SQL as:
... WHERE some_text LIKE 'ttl%=%1';
and will be correctly executed by Firebird.
Generally speaking:
More powerful RegExps are already in FB, see
src/jrd/evl_like.cpp, but not exposed to the SQL
frontend (yet).
----------------------
User: rdifalco
Logged In: YES
user_id=571449
This is a VERY cool thing about MySQL. It allows regular
expression selects on VARCHAR or TEXT BLOB columns. This
is quite powerful and regular expressions are more and
more
becoming the standard for text searching and matching.
For example, I can do:
some_text matches "ttl*.=*.1"
To match "ttl=1", "ttl =1", "ttl= 1", "ttl = 1", etc.
----------------------
User: groovbird
Logged In: YES
user_id=17128
Wildcards are patterns, Regular Expressions are patterns,
but a lot more flexible. I suggest you take a look at the
following documents:
http://sitescooper.org/tao_regexps.html
http://lib.stat.cmu.edu/scgn/v52/section1_7_0_1.html
----------------------
User: helebor
Logged In: YES
user_id=60469
How is this RegEx different to a CONTAINING clause?
select blah,.... from foo
where blahsomething CONTAINING 'blah' ;
Are you talking about wildcards?
----------------------
User: groovbird
Logged In: YES
user_id=17128
A Regular Expression is a way of testing wether a string
matches a certain pattern. Regular Expressions are
commonly known among Unix developers; it exists in the
most popular scripting languages, from Perl to PHP. It
originates from the unix command "grep".
The "like" clause in SQL today has a similar purpose,
allthough the possibilities are extremely limited.
In most implementations, a RegEx can be compiled to be
reused against a number of strings. This way, it would be
nice to have a "like" clause using Regular expressions.
Given the following example:
select * from employees where name matches '^[ab]';
would select all employees whose name starts with either a
or b.
Implementations of Regular Expressions for use in Unix
C/C++ aplications are readily available as a shared
library, but I'm myself not an experienced C developer
so I
wouldn't be able to just "jump in" and do it myself.
====== Test Details ======
See also test for CORE2006
The text was updated successfully, but these errors were encountered: