Simple "Find and Replace" TextModification [message #1823537] |
Sat, 28 March 2020 15:03 |
Sina Madani Messages: 160 Registered: November 2015 Location: York, UK |
Senior Member |
|
|
Hi,
I've been tearing my hair out trying to edit the default workspace for a new install. The problem is on Windows this requires escaping backslashes in "configuration:/.settings/org.eclipse.ui.ide.prefs". So I have a TextModification task with the following properties:
<setupTask
xsi:type="setup:TextModifyTask"
url="configuration:/.settings/org.eclipse.ui.ide.prefs">
<modification
pattern="(.*=[A-Z]\:)(?:(\\)([\w|-]+))+">
<substitution>\1</substitution>
<substitution>\2\\</substitution>
<substitution>\3</substitution>
</modification>
<description>Formats workspace path in RECENT_WORKSPACES</description>
</setupTask>
The file is:
RECENT_WORKSPACES=C:\Users\Sina-\Epsilon\epsilon-Interim\workspace
MAX_RECENT_WORKSPACES=5
RECENT_WORKSPACES_PROTOCOL=3
SHOW_RECENT_WORKSPACES=false
SHOW_WORKSPACE_SELECTION_DIALOG=false
eclipse.preferences.version=1
It's obvious what I'm trying to do: replace \ with \\. But I'm not smart enough to work this out. I've looked at the source code and I get what it's doing, but for something so simple as this, isn't there an easier way?!
Thanks.
[Updated on: Sat, 28 March 2020 15:04] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02564 seconds