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

16
LINES

< > BotCompany Repo | #1012521 // compileRegexpIC

JavaX fragment (include)

1  
static Map<S, java.util.regex.Pattern> compileRegexpIC_cache = syncMRUCache(10);
2  
3  
static java.util.regex.Pattern compileRegexpIC(S pat) {
4  
  java.util.regex.Pattern p = compileRegexpIC_cache.get(pat);
5  
  if (p == null) {
6  
    ifdef compileRegexp_debug
7  
      print("Compiling regexp (IC): " + pat);
8  
    endifdef
9  
    try {
10  
      compileRegexpIC_cache.put(pat, p = java.util.regex.Pattern.compile(pat, Pattern.CASE_INSENSITIVE));
11  
    } catch (PatternSyntaxException e) {
12  
      throw rethrow(wrapPatternSyntaxException(e));
13  
    }
14  
  }
15  
  ret p;
16  
}

Author comment

Began life as a copy of #1007003

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012521
Snippet name: compileRegexpIC
Eternal ID of this version: #1012521/7
Text MD5: c13878d35414e75f1fe575af0389c8a3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-20 11:30:45
Source code size: 552 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 503 / 632
Version history: 6 change(s)
Referenced in: [show references]