[R] gsub issue with consecutive pattern finds

Iago Giné Vázquez |@go@g|ne @end|ng |rom @jd@e@
Fri Mar 1 12:36:46 CET 2024


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 between each pair of consecutive vowels)?


Thank you!

Best regards,

Iago

	[[alternative HTML version deleted]]



More information about the R-help mailing list