Skip to content
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

Closed
firebird-issue-importer opened this issue Sep 17, 2003 · 16 comments

Comments

@firebird-issue-importer

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 16, 2006

Modified by: @pcisar

issuetype: New Feature [ 2 ] => Improvement [ 4 ]

assignee: Dmitry Yemanov [ dimitr ]

SF_ID: 807985 =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 6, 2006

Modified by: @pcisar

assignee: Dmitry Yemanov [ dimitr ] =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 28, 2006

Commented by: @asfernandes

Will be done with the SQL standard SIMILAR predicate.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 28, 2006

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

SF_ID: 807985 =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 13, 2007

Modified by: @dyemanov

Fix Version: 2.5 Alpha 1 [ 10224 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 15, 2007

Commented by: Dimitrios Chr. Ioannidis (dchri)

Use of the new Target Final Release Version field.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 15, 2007

Modified by: Dimitrios Chr. Ioannidis (dchri)

Target Final Release Version: 2.5.0 [ 10221 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 25, 2007

Modified by: @asfernandes

issuetype: Improvement [ 4 ] => New Feature [ 2 ]

summary: Wildcards/Regular Expressions in WHERE clause => Wildcards/Regular Expressions in WHERE clause - SIMILAR TO predicate

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 25, 2007

Commented by: @asfernandes

Implemented SIMILAR TO predicate.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 25, 2007

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2008

Modified by: @pcisar

Workflow: jira [ 10793 ] => Firebird [ 15192 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 11, 2008

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 23, 2011

Modified by: @pcisar

Link: This issue is related to QA292 [ QA292 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 21, 2011

Modified by: @pmakowski

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 28, 2015

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test

Test Details: See test for CORE2006

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 4, 2016

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Done successfully

Test Details: See test for CORE2006 => See also test for CORE2006

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants