findPat {PBSmodelling}R Documentation

Search a Vector With Multiple Patterns

Description

Searches all patterns in pat from vec, and returns the matched elements in vec.

Usage

findPat(pat, vec) 

Arguments

pat character vector of patterns to match in vec
vec character vector where matches are sought

Value

A character vector of all matched strings.

Examples

#find all strings with a vowel, or that start with a number
findPat(c("[aeoiy]", "^[0-9]"), c("hello", "WRLD", "11b"))

[Package PBSmodelling version 0.60 Index]