Skip to contents

Takes a character vector and returns it with matches of pattern wrapped in html tags used for highlighting

Usage

cass_highlight(string, pattern, ignore_case = TRUE)

Arguments

string

A character vector.

ignore_case

Defaults to TRUE.

param

Pattern to match.

Examples

cass_highlight(
  string = c(
    "The R Foundation for Statistical Computing",
    "R is free software and comes with ABSOLUTELY NO WARRANTY"
  ),
  pattern = "foundation|software|warranty"
)
#> [1] "The R <mark>Foundation</mark> for Statistical Computing"                           
#> [2] "R is free <mark>software</mark> and comes with ABSOLUTELY NO <mark>WARRANTY</mark>"