Hello,
I’m trying to make a regex search and replace certain characters in fields in snippets. I currently have 3 groups that I try to put through. It’s probably more of a regex problem than Sublime Text, but I hope someone else has had a similar issue.
Code example where each particular replacement works:
[code]<![CDATA[
${1:Name with dirty characters}
Replacement of æ: ${1/æ/ae/g}
Replacement of ø: ${1/ø/oe/g}
Replacement of å: ${1/å/aa/g}
Replacement of Æ: ${1/Æ/Ae/g}
Replacement of Ø: ${1/Ø/Oe/g}
Replacement of Å: ${1/Å/Aa/g}
]]>[/code]
Output:
[code]Æblegrød med Øllebrød og Ålesovs åbne øl nær Solrød
Replacement of æ: Æblegrød med Øllebrød og Ålesovs åbne øl naer Solrød
Replacement of ø: Æblegroed med Øllebroed og Ålesovs åbne oel nær Solroed
Replacement of å: Æblegrød med Øllebrød og Ålesovs aabne øl nær Solrød
Replacement of Æ: Aeblegrød med Øllebrød og Ålesovs åbne øl nær Solrød
Replacement of Ø: Æblegrød med Oellebrød og Ålesovs åbne øl nær Solrød
Replacement of Å: Æblegrød med Øllebrød og Aalesovs åbne øl nær Solrød[/code]
Great, that works! The problem is that I want make all of those replacements work at once, so I tried adding this:
Replacement of all of those bad characters: ${1:/(æ)(ø)(å)(Æ)(Ø)(Å)]/(ae)(oe)(aa)(Ae)(Oe)(Aa)/g}
Which renders a useless output:
Replacement of all of those bad characters: Æblegrød med Øllebrød og Ålesovs åbne øl nær Solrød
Anybody able to discern what I am doing wrong?