Libraryless. Click here for Pure Java version (2765L/18K).
1 | sS handleHashtags(S text, IF1<S> handler) { |
2 | LS tok = regexpICMatchesAsCNC(regexpNegativeLookbehind("\\w") + "#\\w+\\b", text); |
3 | if (l(tok) == 1) ret text; // no hashtags found |
4 | |
5 | for (int i = 1; i < l(tok); i += 2) |
6 | tok.set(i, unnull(handler.get(tok.get(i)))); |
7 | |
8 | ret join(tok); |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1029381 |
Snippet name: | handleHashtags |
Eternal ID of this version: | #1029381/1 |
Text MD5: | 3897c48a441c51639e5977bfb629b563 |
Transpilation MD5: | 33edc141394e9736f4265ef7e1bbae9b |
Author: | stefan |
Category: | javax / chat bots |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-08-03 14:28:45 |
Source code size: | 298 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 200 / 294 |
Referenced in: | [show references] |