Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1013715 // compileRegexp

JavaX fragment (include)

1  
static Map<S, java.util.regex.Pattern> compileRegexp_cache = syncMRUCache(10);
2  
3  
static java.util.regex.Pattern compileRegexp(S pat) {
4  
  java.util.regex.Pattern p = compileRegexp_cache.get(pat);
5  
  if (p == null) {
6  
    ifdef compileRegexp_debug
7  
      print("Compiling regexp: " + pat);
8  
    endifdef
9  
    compileRegexp_cache.put(pat, p = java.util.regex.Pattern.compile(pat));
10  
  }
11  
  ret p;
12  
}

Author comment

Began life as a copy of #1012521

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1013715
Snippet name: compileRegexp
Eternal ID of this version: #1013715/6
Text MD5: 46a6b79f6eb85a33ace7349255a3be8a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-03 10:19:45
Source code size: 398 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 540 / 568
Version history: 5 change(s)
Referenced in: [show references]