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

12
LINES

< > BotCompany Repo | #1022868 // pAttractor_allMatches

JavaX fragment (include)

static LS pAttractor_allMatches(PartialAttractor a, LS tok) {
  int i = 0;
  new LS out;
  while (licensed() && i < l(tok)) {
    a.tok = subList(tok, i);
    if (!a.find()) break;
    assertTrue("match must not be empty", a.matchedRange.end >= 2);
    out.add(a.matchedString());
    i += a.matchedRange.end & ~1; // go to next N token
  }
  ret out;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022868
Snippet name: pAttractor_allMatches
Eternal ID of this version: #1022868/2
Text MD5: 9e7c49cb8410223f8e1cad9399d11a2e
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-12 16:46:30
Source code size: 364 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 179 / 238
Version history: 1 change(s)
Referenced in: [show references]