Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

val_matches

Test that the user's expression matches a regular expression.


Description

Returns TRUE if as.character(e$val) matches the regular expression given as the first argument.

Usage

val_matches(regular_expression)

Arguments

regular_expression

a regular expression which user value should match

Value

TRUE or FALSE

See Also

Examples

## Not run: 
  # Test that a user has entered a value matching
  # '[Cc]ollege [Ss]tudents' or has selected it 
  # in a multiple choice question.
  #
  val_matches('[Cc]ollege [Ss]tudents')

## End(Not run)

swirl

Learn R, in R

v2.4.5
MIT + file LICENSE
Authors
Sean Kross [aut, cre], Nick Carchedi [aut], Bill Bauer [aut], Gina Grdina [aut], Filip Schouwenaars [ctb], Wush Wu [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.