Magic!
tmp %>%
as_tibble() %>%
rename(Text = value) %>%
mutate(Text = str_replace_all(Text, fixed("."), "")) %>%
# filter(row_number() < 4) %>%
mutate(Text2 = gsub("((|/)[[:alnum:]]+)|(\\([[:alnum:]-]+\\))",
"", Text))
Which (as you have already shown!) gave me this:
# A
OK, so you want parentheses, not "brackets" + I think I misinterpreted your
specification, which I think is actually incomplete. Based on what I think
you meant, how does this work:
gsub("((|/)[[:alnum:]]+)|(\\([[:alnum:]-]+\\))", "",tmp$Text)
[1] "Я досяг того, чого хотів" "Мені
Does this do it for you (or get you closer):
gsub("\\[.*\\]|[] |/ ","",tmp$Text)
[1] "Я досяг того, чого хотів"
[2] "Мені вдалося\nзробити бажане"
[3] "Я досяг (досягла) того, чого хотів (хотіла)"
[4] "Я\nдосяг(-ла) речей, яких хотілося досягти"
[5] "Я досяг/ла того, чого\nхотів/ла"
[6] "Я
Thanks Avi (I am a keen follower or your, and other stalwart helpers here).
On 27/06/2023 18:27, avi.e.gr...@gmail.com wrote:
Chris,
Consider breaking up your task into multiple passes.
Sorry, I could have explained more of what I had tried. I never know
how long to make things here.
I
Chris,
Consider breaking up your task into multiple passes.
And do them in whatever order preserves what you need.
First, are you talking about brackets as in square brackets, or as in your
example, parentheses?
If you are sure you have no nested brackets, your requirement seems to be that
5 matches
Mail list logo