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

15
LINES

< > BotCompany Repo | #1014592 // matchX - select one of the matching functions (matchStartX, matchEndX, find3, match)

JavaX fragment (include)

1  
static bool matchX(S pat, S s) {
2  
  ret matchX(pat, s, null);
3  
}
4  
5  
static bool matchX(S pat, S s, Matches m) {
6  
  if (endsWith(pat, "...")) {
7  
    pat = dropSuffixTrim("...", pat);
8  
    if (startsWith(pat, "..."))
9  
      ret find3(dropPrefixTrim("...", pat), s, m);
10  
    else
11  
      ret matchStart(pat, s, m);
12  
  }      
13  
  if (startsWith(pat, "...")) ret matchEndX(pat, s, m);
14  
  ret match(pat, s, m);
15  
}

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: #1014592
Snippet name: matchX - select one of the matching functions (matchStartX, matchEndX, find3, match)
Eternal ID of this version: #1014592/6
Text MD5: 4affb3b4f3d81b626bf4d3bc48c90847
Author: stefan
Category: javax / parsing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-16 16:32:23
Source code size: 406 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 370 / 428
Version history: 5 change(s)
Referenced in: [show references]