We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9a74dcd commit 8fce932Copy full SHA for 8fce932
Source/Scene/ModelUtility.js
@@ -167,17 +167,12 @@ define([
167
}
168
};
169
170
- function regexIndexOf(text, regex, i) {
171
- var indexInSuffix = text.slice(i).search(regex);
172
- return indexInSuffix < 0 ? indexInSuffix : indexInSuffix + i;
173
- }
174
-
175
function replaceAllButFirstInString(string, find, replace) {
176
// Limit search to strings that are not a subset of other tokens.
177
- find += '(?![a-zA-Z_$])';
+ find += '(?![a-zA-Z0-9_])';
178
find = new RegExp(find, 'g');
179
180
- var index = regexIndexOf(string, find, 0);
+ var index = string.search(find);
181
return string.replace(find, function(match, offset) {
182
return index === offset ? match : replace;
183
});
0 commit comments