An R Interface to the Onigmo Regular Expression Library
Overview
Provides an alternative to R's built-in functionality for handling regular expressions, based on the Onigmo library. Offers first-class compiled regex objects, partial matching and function-based substitutions, amongst other features.
- The bundled Onigmo regular expression library has been brought up to date with fixes made since version 6.2.0, both upstream and in the copy maintained as part of Ruby. These address a number of crashes, memory errors and incorrect results, particularly with unusual or malformed regexes.
- Unicode data has been updated from version 9.0 to version 17.0, so character properties (
\p{...}) and case-insensitive matching now cover recent additions such as additional scripts and emoji. The\X(extended grapheme cluster) escape, which previously crashed R when used with UTF-8 text, now works and follows current Unicode segmentation rules. - A group that matches an empty string is now returned as an empty string, rather than
NA. Groups that don't take part in a match are stillNA, and their offsets and lengths are nowNAtoo.
Show all changes in 1.8.0Hide the rest of the changes in 1.8.0
- When several replacement strings are given to
ore_subst(), they are now applied to successive matches, as documented. Previously the last one used was applied to all matches, unless the replacements contained back-references. - Strings with no declared encoding (such as those read by
readLines()without itsencodingargument) are now matched in the encoding given by theore.encodingoption when the regex is given as a string, rather than being treated as ASCII. Previously, for example,\wwould not match accented letters in such strings. - Encoding names are now matched in full, and in a case-insensitive and separator-insensitive way, so names such as "ISO-8859-15" are now handled correctly rather than being treated as ISO-8859-1 (due to a partial match). The "LATINn" aliases now refer to the standard encodings, and unrecognised names give a warning.
- Text read from files or connections in encodings other than ASCII, UTF-8 or Latin-1 (e.g., Shift-JIS) is now converted to UTF-8 when returned to R.
- Searching files in UTF-16 or UTF-32 now works.
- Results from UTF-8 text are no longer corrupted when the session locale uses a different encoding.
- Vectors mixing UTF-8 and Latin-1 strings are now searched fully when the regex is given as a string, rather than elements in the "other" encoding being skipped with a warning.
- Regexes created with
ore()and then saved (e.g., withsaveRDS()) and loaded again now keep their options and syntax. - Starting positions passed to the main functions must now be positive integers; zero, negative and
NAvalues produce an error rather than being quietly treated as giving no match. Starting positions beyond the end of the text, which crashed R with multibyte encodings, now consistently give no match. - Calling
ore()with a missing (NA) pattern is now an error, and unsupported letters in itsoptionsargument produce a warning rather than being ignored. ore_repl()now passes the correct matched text to replacement functions when there are several matches and the regex contains groups, and no longer fails when there are several groups and several matches.- Back-references to groups that don't take part in a match, or match an empty string, previously crashed R. They are now replaced with nothing.
- The
\Ganchor could match when it shouldn't, because a failed search was retried from later in the text. Failed searches are no longer repeated, which also makes searches faster when many strings don't match. - Character offsets of repeated empty matches were wrong in multibyte encodings. This has been corrected.
- Searching large numbers of strings, with
ore_search()or%~%, is now substantially faster, due to more efficient memory use. - Printed matches now use display widths based on current Unicode data, so emoji, wide characters and newer combining marks line up correctly. Text is converted to the session's encoding for display, with characters that can't be shown replaced by "?", and carriage returns are shown as "\r". A crash when printing text containing many zero-width characters has been fixed.
es()now only removes the escape from "\\#{", leaving other backslashes intact.- Connections opened by the package in order to search them are now closed again afterwards. Connections that were already open are left open.
ore_escape()now preserves the declared encoding of its argument.- The native encoding is now detected more reliably when the package is loaded, using R's own locale information where possible. In a Latin-1 locale the
ore.encodingoption is now set to "latin1", and the C locale is treated as ASCII without a startup message.
From NEWS in the release
Install
Health
NOTEcompiled coder-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64
r-oldrel-macos-arm64, r-oldrel-macos-x86_64
File ‘ore/libs/ore.so’: Found non-API calls to R: ‘R_GetConnection’, ‘R_ReadConnection’ Compiled code should not call non-API entry points in R. See ‘Writing portable packages’ in the ‘Writing R Extensions’ manual, and section ‘Moving into C API compliance’ for issues with the use of non-API entry points.
r-oldrel-windows-x86_64
File 'ore/libs/x64/ore.dll': Found non-API calls to R: 'R_GetConnection', 'R_ReadConnection' Compiled code should not call non-API entry points in R. See 'Writing portable packages' in the 'Writing R Extensions' manual, and section 'Moving into C API compliance' for issues with the use of non-API entry points.
- NOTE10 OK, 3 NOTENow
- NOTE11 OK, 2 NOTE2026-10-08
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 13
- Examples that run
- 100%8 run in a plain check
- Exported functions with examples
- 67%
- Documented parameters
- 98%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 1
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
Commits over time
6 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/jonclayden/ore on 2026-10-18.
The R CMD check workflow runs on Linux and Windows
Dependencies
Installing ore adds no packages beyond those that come with R.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 1.8.0Latest
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 1.7.5.12025-03-14 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 1.7.4.12023-12-05 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 1.7.3.12023-01-16 · diff ↗
- 1.7.2.12022-11-01 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 1.7.1.12021-11-02 · diff ↗
- 1.7.02021-10-12 · diff ↗ ·
added 6 exports
ore.match, ore.repl, ore.switch, ore_match, ore_repl, ore_switch - RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- 1.6.32019-11-02 · diff ↗
- RR 3.6.0 released · 2019-04-26
Show 19 earlier eventsHide 19 earlier events
- 1.6.22018-08-30 · diff ↗
- 1.6.12018-05-22 · diff ↗
- RR 3.5.0 released · 2018-04-23
- RR 3.4.0 released · 2017-04-21
- 1.6.02017-04-14 · diff ↗
- 1.5.02016-09-09 · diff ↗
- 1.4.0
- RR 3.3.0 released · 2016-05-03
- 1.3.0
- 1.2.22016-01-27 · diff ↗
- 1.2.12015-08-10 · diff ↗
- 1.2.02015-07-17 · diff ↗ ·
added 8 exports
is_ore, is_orematch, ore_dict, ore_ismatch, ore_lastmatch, ore_search, ore_split, ore_subst - RR 3.2.0 released · 2015-04-16
- 1.1.0
- 1.0.62015-01-01 · diff ↗
- 1.0.42014-11-25 · diff ↗
- 1.0.12014-10-22 · diff ↗
- 1.0.02014-10-20
- RR 3.1.0 released · 2014-04-10
Package metadata
- First published
- 2014-10-20
- Total releases
- 22 / 12 yrs
- License
- BSD_3_clause + file LICENCE OSI
- Bundled data
- 5.3 KB / 1 file
- Download size
- 488 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("ore")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.