initRegExp: Add regular expression operator

Description Usage Arguments Details Value Examples

View source: R/regularExpressions.R

Description

This loads a regular-expression matcher for posix extended regular expressions, as available through the SQLite source code repository (https://sqlite.org/src/raw?filename=ext/misc/regexp.c).

Usage

1

Arguments

db

A SQLiteConnection object to add the regular expression operator into the connection.

Details

SQLite will then implement the "A regexp B" operator, where A is the string to be matched and B is the regular expression.

Note this only affects the specified connection.

Value

Always TRUE, invisibly.

Examples

1
2
3
4
5
6
library(DBI)
db <- RSQLite::datasetsDb()
RSQLite::initRegExp(db)

dbGetQuery(db, "SELECT * FROM mtcars WHERE carb REGEXP '[12]'")
dbDisconnect(db)

RSQLite documentation built on Aug. 21, 2021, 5:07 p.m.