Libraryless. Click here for Pure Java version (3847L/22K).
1 | sS starToDotStarRegexp(S s) { |
2 | int i = 0; |
3 | new StringBuffer buf; |
4 | while (i < l(s)) { |
5 | int j = smartIndexOf(s, "*", i); |
6 | buf.append(regexpQuote(substring(s, i, j))); |
7 | if (j >= l(s)) break; |
8 | buf.append(".*"); |
9 | i = j+3; |
10 | } |
11 | ret str(buf); |
12 | } |
Began life as a copy of #1024110
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032800 |
Snippet name: | starToDotStarRegexp |
Eternal ID of this version: | #1032800/2 |
Text MD5: | cd18a497f7eca27b65c59e26d70039a5 |
Transpilation MD5: | 836e5077d4e2700fbd261e4f6bfda8e0 |
Author: | stefan |
Category: | javax / regexp |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-10-06 07:46:42 |
Source code size: | 267 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 170 / 204 |
Version history: | 1 change(s) |
Referenced in: | [show references] |