1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Allow symmetrical patterns for replace keys

Update getReplaceKeys to allow for patterns with matching start and end delimiters. Previously, `%%key%%` would throw and OutOfBoundsException instead of matching the key inside the delimiters.
This commit is contained in:
Dillon Shaffer 2023-04-09 11:03:22 -06:00 committed by Jonah Graham
parent ad15e0e804
commit eb237ebcba

View file

@ -97,7 +97,7 @@ public class ProcessHelper {
int start = 0;
int end = 0;
while ((start = str.indexOf(startPattern, start)) >= 0) {
end = str.indexOf(endPattern, start);
end = str.indexOf(endPattern, start + startPattern.length());
if (end != -1) {
replaceStrings.add(str.substring(start + startPattern.length(), end));
start = end + endPattern.length();