I am trying to replace slashes in a string, but not all of them are only those that are before the first comma. To do this, I probably should find a way to match only slashes, followed by a line containing a comma.
Is it possible to do this using one regexp, i.e. without first breaking the line with commas?
Example input line:
Abc1/Def2/Ghi3,/Dore1/Mifa2/Solla3,Sido4
What I want to get:
Abc1.Def2.Ghi3,/Dore1/Mifa2/Solla3,Sido4
I tried some lookahead and lookbehind methods without effect, so this is currently being done, for example, Python, I split the data first:
test = 'Abc1/Def2/Ghi3,/Dore1/Mifa2/Solla3,Sido4'
strlist = re.split(r',', test)
result = ','.join([re.sub(r'\/', r'.', strlist[0])] + strlist[1:])
regexp Python- , pattern replacement, :
result = re.sub(pattern, replacement, test)
, , - , , (, sed Python).