regex - Replace nth occurence of a character by another -
i hope isn't duplicated, didn't find answer , need regexp wizards.
i have string , replace second space found in \n
, don't know how use indices (this way) in regular expression :
for example :
# have : "a b c d e f" # want : > "a b/nc d e f"
also know how can "repeat" replacement: each 2 occurences of space replace \n
. example :
"a b c d e f" > "a b\nc d\ne f"
Comments
Post a Comment