R ile Orta Düzey Düzenli İfadeler
Angelo Zehr
Data Journalist
str_match(
"payload: 'Adam, 5, 3', headers: 'Auth...'",
pattern = "[A-Za-z]+, \\d+, \\d+"
)
Sonuç:
[,1]
[1,] "Adam, 5, 3"
str_match(
"payload: 'Adam, 5, 3', headers: 'Auth...'",
pattern = "([A-Za-z]+), (\\d+), (\\d+)"
)
Şu sonucu verir:
[,1] [,2] [,3] [,4]
[1,] "Adam, 5, 3" "Adam" "5" "3"
str_replace(
"payload: 'Adam, 5, 3', headers: 'Auth...'",
pattern = "([A-Za-z]+), (\\d+), (\\d+)",
replacement = "\\1 \\2 kez oturum açmayı denedi."
)
Şunu döndürür:
"payload: 'Adam 5 kez oturum açmayı denedi.', headers: 'Auth...'"`
str_split(
"a:b:c:d",
pattern = ":",
simplify = FALSE
)
[[1]]
[1] "a" "b" "c" "d"
str_split(
"a:b:c:d",
pattern = ":",
simplify = TRUE
)
[,1] [,2] [,3] [,4]
[1,] "a" "b" "c" "d"
R ile Orta Düzey Düzenli İfadeler