Learn R Programming

nc (version 2026.2.20)

Named Capture to Data Tables

Description

User-friendly functions for extracting a data table (row for each match, column for each group) from non-tabular text data using regular expressions, and for melting columns that match a regular expression. Patterns are defined using a readable syntax that makes it easy to build complex patterns in terms of simpler, re-usable sub-patterns. Named R arguments are translated to column names in the output; capture groups without names are used internally in order to provide a standard interface to three regular expression 'C' libraries ('PCRE', 'RE2', 'ICU'). Output can also include numeric columns via user-specified type conversion functions.

Copy Link

Version

Install

install.packages('nc')

Monthly Downloads

376

Version

2026.2.20

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Toby Hocking

Last Published

February 26th, 2026

Functions in nc (2026.2.20)

check_df_names

check df names
measure_multiple

measure multiple
capture_melt_single

Capture and melt into a single column
field

Capture a field
capture_longer_spec

capture longer spec
measure

measure
quantifier

quantifier
group

Capture group
collapse_some

collapse some
measure_single

measure single
try_or_stop_print_pattern

try or stop print pattern
melt_list

melt list
only_captures

only captures
var_args_list

var args list
stop_for_subject

stop for subject
subject_var_args

subject var args
stop_for_capture_same_as_id

stop for capture same as id
stop_for_engine

stop for engine
alevels

Alternative levels
capture_first_df

Capture first match in columns of a data frame
altlist

altlist
alternatives

alternatives
alternatives_with_shared_groups

alternatives with shared groups
capture_first_glob

capture first glob
apply_type_funs

apply type funs
capture_first_vec

Capture first match in each character vector element
capture_all_str

Capture all matches in a single subject string
before_match

before match
check_names

check names
capture_melt_multiple

Capture and melt into multiple columns