Libraryless. Click here for Pure Java version (2827L/17K).
sS regexpReplace_direct(S s, S pat, S replacement) { Matcher m = regexp(pat, s); ret regexpReplace_direct(m, replacement); } sS regexpReplace_direct(Matcher m, S replacement) { new StringBuffer buf; while (m.find()) m.appendReplacement(buf, replacement); m.appendTail(buf); ret str(buf); }
Began life as a copy of #1018263
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1021370 |
Snippet name: | regexpReplace_direct - with direct replacement |
Eternal ID of this version: | #1021370/3 |
Text MD5: | 25740a782dedf1e5488f6be1b349a131 |
Transpilation MD5: | 3522ea83132618c7668440c59f9b2689 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-04-19 13:07:03 |
Source code size: | 319 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 332 / 428 |
Version history: | 2 change(s) |
Referenced in: | [show references] |