问题
I'm trying to find and replace a string into the wanted string, but can't get it to work.
For example:
1777: '23.5R25 Bridgestone VLT **',
Should be:
1777: '23.5R25-Bridgestone-VLT-**',
I'm having like 1,700 lines like this and want every whitespace between the single quotes to dashes. I'm using Notepad++ for this.
My approach:
Find: '(.*?)\s+(.*?)'
Replace: '\1-\2'
But this works for just 2 words.
回答1:
\s(?!(?:[^']*'[^']*')*[^']*$)
You can use this and replace by -.See demo.
https://regex101.com/r/vP2zF2/2
来源:https://stackoverflow.com/questions/33363744/regex-replace-whitespaces-between-single-quotes