regex - R string match between tags -
How to obtain all file names in a directory in R, for which is the start and end name known?
list.files (dir_path, pattern = "^ my_")
All files that are "my_"
Returns from list.files (DIR_path, Pattern = "R. $")
All files that are "R."
But how do I implement both patterns?
list.files (dir_path, pattern = "^ my _ *. R")
gives character (0)
You can use the following regular expression:
^ _ _ * \\. R
BTW, .
matches any character, then . $
mail AIR
, not only the files that end with .
. If you want to match to
You really have to save it.
list.files (dir_path, pattern = "^ my _. * \\. R $")
Comments
Post a Comment