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

13
LINES

< > BotCompany Repo | #1004321 - jextract - jfind and return found text [first parameter is pattern!]

JavaX fragment (include)

// returns from C to C
static S jextract(S pat, S s) {
  ret jextract(pat, javaTok(s));
}

static S jextract(S pat, L<S> tok) {
  L<S> tokpat = javaTok(pat);
  jfind_preprocess(tokpat);
  int i = jfind(tok, tokpat);
  if (i < 0) null;
  int j = i + l(tokpat) - 2;
  ret joinSubList(tok, i, j);
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004321
Snippet name: jextract - jfind and return found text [first parameter is pattern!]
Eternal ID of this version: #1004321/3
Text MD5: b81775abba4529835fcc646d176333b0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-15 00:29:26
Source code size: 309 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 431 / 735
Version history: 2 change(s)
Referenced in: #1006654 #1014474 #1018006 #1030231

Formerly at http://tinybrain.de/1004321 & http://1004321.tinybrain.de