Top "Gsub" questions

Ruby, Lua, R and Awk methods for performing a global pattern substitution.

Replace specific characters within strings

I would like to remove specific characters from strings within a vector, similar to the Find and Replace feature in …

r regex replace gsub string-substitution
Remove pattern from string with gsub

I am struggling to remove the substring before the underscore in my string. I want to use * (wildcard) as the …

r gsub
Lua String replace

How would i do this? I got this: name = "^aH^ai" string.gsub(name, "^a", "") which should return "Hi", but …

string replace lua gsub lua-patterns
Removing Whitespace From a Whole Data Frame in R

I've been trying to remove the white space that I have in a data frame (using R). The data frame …

r replace whitespace gsub
gsub() in R is not replacing '.' (dot)

I want to replace dots in "2014.06.09" to "2014-06-09". I am using gsub() function for it. If x <- "2014.06.09" …

r regex gsub
replacing the `'` char using awk

I have lines with a single : and a' in them that I want to get rid of. I want to …

awk gsub
How to use ruby gsub Regexp with many matches?

I have csv file contents having double quotes inside quoted text test,first,line,"you are a "kind" man",thanks …

ruby regex csv gsub string-substitution
Ruby multiple string replacement

str = "Hello☺ World☹" Expected output is: "Hello:) World:(" I can do this: str.gsub("☺", ":)").gsub("☹", ":(") Is there any other way …

ruby string gsub
How to remove specific special characters in R

I have some sentences like this one. c = "In Acid-base reaction (page[4]), why does it create water and not H+?" …

r regex character gsub
Replace multiple letters with accents with gsub

of course I could replace specific arguments like this: mydata=c("á","é","ó") mydata=gsub("á","a",mydata) mydata=gsub("é","e",mydata) mydata=…

r regex gsub