A list of regular expressions commonly used for parsing and validating data inputs.

regexes

Format

A named list of character vectors, each containing a regular expression:

area

Matches area values including units (e.g., "px", "cm2").

area_si

Matches area values with SI units only (e.g., "cm2").

area_units

Matches area unit abbreviations (e.g., "px", "cm2").

area_units_si

Matches area units with SI abbreviations only (e.g., "cm2").

dec_number

Matches decimal numbers (e.g., "1.23").

dist

Matches distance values either in pixels or SI units.

dist_units_si

Matches distance unit abbreviations with SI units only (e.g., "cm", "m").

exclam

Matches values followed by an exclamation mark and optional unit.

exclam1

Matches values with units followed by an exclamation mark.

exclam2

Matches values followed by an exclamation mark.

mitochondrial

Matches mitochondrial gene names starting with "MT-".

num_value

Matches numeric values, including decimal and scientific notation.

number

Matches integer numbers (e.g., "123").

percentage

Matches percentage values (e.g., "50%").

pxl

Matches pixel units ("px").

pxl_area

Matches pixel area values.

pxl_dec_num

Matches pixel values with decimal numbers.

pxl_dist

Matches pixel distance values.

pxl_num

Matches pixel values with integer numbers.

ribosomal

Matches ribosomal protein genes (e.g., "RPL", "RPS").

scientific_notation

Matches numbers in scientific notation (e.g., "1e-3").

si_dist

Matches SI unit distance values.

unit

Matches unit abbreviations including pixels and SI units.

Examples

regexes$mitochondrial
regexes$number