Extention for grep function

Description

grep a string whether in another string or vector, the string are split by space.

Usage

1
grep_split(keyword, x)

Arguments

keyword

a character string, separator "|" is permitted.

x

a character vector where matches are sought.

Details

Extention for grep functin.

Value

The function return the numbers vector which contain the keyword.

Author(s)

Zongfu Cao

See Also

grep

Examples

1
2
3
x <- c("you and he and I", "you", "Tom", "I", "you and I", "he and I")
grep_split("you and I | Tom", x)
#[1] 1 5 3