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

14
LINES

< > BotCompany Repo | #1012768 // singleEllipsisMatchIC - match "bla ... bla" (case insensitive)

JavaX fragment (include)

1  
static bool singleEllipsisMatchIC(S pat, S s, Matches m) {
2  
  int i = indexOf(pat, "...");
3  
  if (i < 0) ret eqic(pat, s);
4  
  if (!regionMatchesIC(s, 0, pat, 0, i)) false;
5  
  int lSuffix = l(pat)-(i+3);
6  
  if (!regionMatchesIC(s, l(s)-lSuffix, pat, i+3, lSuffix)) false;
7  
  if (m != null)
8  
    m.m = new S[] {substring(s, i, l(s)-lSuffix)};
9  
  true;
10  
}
11  
12  
static bool singleEllipsisMatchIC(S pat, S s) {
13  
  ret singleEllipsisMatchIC(pat, s, null);
14  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1012768
Snippet name: singleEllipsisMatchIC - match "bla ... bla" (case insensitive)
Eternal ID of this version: #1012768/4
Text MD5: ab79be48d822eee9d860db286564ab35
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-13 01:16:41
Source code size: 450 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 472 / 484
Version history: 3 change(s)
Referenced in: [show references]