search for: aeiouaeiou

Displaying 4 results from an estimated 4 matches for "aeiouaeiou".

2024 Mar 01
1
gsub issue with consecutive pattern finds
...PERL type matching. The idea: separate the two vowels in the regex by a character that you know cannot appear (if there is such) and match it optionally, e.g. with '*" repetition specifier. I used "?" for the optional character below (which must be escaped). > gsub("([aeiouAEIOU])\\?*([aeiouAEIOU])", "\\1_\\2", "aerioue") [1] "a_eri_ou_e" Cheers, Bert On Fri, Mar 1, 2024 at 3:59?AM Iago Gin? V?zquez <iago.gine at sjd.es> wrote: > > Hi Iris, > > Thank you. Further, very nice solution. > > Best, > > Iago &gt...
2024 Mar 01
1
gsub issue with consecutive pattern finds
Hi Iris, Thank you. Further, very nice solution. Best, Iago On 01/03/2024 12:49, Iris Simmons wrote: > Hi Iago, > > > This is not a bug. It is expected. Patterns may not overlap. However, there > is a way to get the result you want using perl: > > ```R > gsub("([aeiouAEIOU])(?=[aeiouAEIOU])", "\\1_", "aerioue", perl = TRUE) > ``` > > The specific change I made is called a positive lookahead, you can read > more about it here: > > https://www.regular-expressions.info/lookaround.html > > It's a way to check for a pie...
2024 Mar 01
1
gsub issue with consecutive pattern finds
Hi Iago, This is not a bug. It is expected. Patterns may not overlap. However, there is a way to get the result you want using perl: ```R gsub("([aeiouAEIOU])(?=[aeiouAEIOU])", "\\1_", "aerioue", perl = TRUE) ``` The specific change I made is called a positive lookahead, you can read more about it here: https://www.regular-expressions.info/lookaround.html It's a way to check for a piece of text without consuming it in th...
2024 Mar 01
1
gsub issue with consecutive pattern finds
Hi all, I tested next command: gsub("([aeiouAEIOU])([aeiouAEIOU])", "\\1_\\2", "aerioue") with the following output: [1] "a_eri_ou_e" So, there are two consecutive vowels where an underscore is not added. May it be a bug? Is it expected (bug or not)? Is there any chance to get what I want (an underscore betw...