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

12
LINES

< > BotCompany Repo | #1013715 // compileRegexp

JavaX fragment (include)

static Map<S, java.util.regex.Pattern> compileRegexp_cache = syncMRUCache(10);

static java.util.regex.Pattern compileRegexp(S pat) {
  java.util.regex.Pattern p = compileRegexp_cache.get(pat);
  if (p == null) {
    ifdef compileRegexp_debug
      print("Compiling regexp: " + pat);
    endifdef
    compileRegexp_cache.put(pat, p = java.util.regex.Pattern.compile(pat));
  }
  ret p;
}

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: 538 / 565
Version history: 5 change(s)
Referenced in: [show references]