Libraryless. Click here for Pure Java version (2903L/17K).
sS regexpReplace_directWithRefs(S s, S pat, S replacement) { Matcher m = regexp(pat, s); ret regexpReplace_direct(m, replacement); } sS regexpReplace_directWithRefs(Matcher m, S replacement) { new StringBuffer buf; while (m.find()) m.appendReplacement(buf, replaceDollarVars2_dyn(replacement, v -> !isInteger(v) ? null : matcherGroup(m, parseInt(v)))); m.appendTail(buf); ret str(buf); }
Began life as a copy of #1030197
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
| Snippet ID: | #1031001 |
| Snippet name: | regexpReplace_directWithRefs |
| Eternal ID of this version: | #1031001/4 |
| Text MD5: | 8b90dd67074f3ed8c0c6e28b570f9dcb |
| Transpilation MD5: | c828b0c48f18a0703dc7a26db2f9934d |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2021-04-19 16:33:29 |
| Source code size: | 424 bytes / 13 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 374 / 503 |
| Version history: | 3 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |