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

6
LINES

< > BotCompany Repo | #1024104 // regexpCount - count number of matches in string

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2331L/15K).

static int regexpCount(S pattern, S s) {
  Matcher m = regexp(pattern, s);
  int n = 0;
  while (m.find()) ++n;
  ret n;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1024104
Snippet name: regexpCount - count number of matches in string
Eternal ID of this version: #1024104/2
Text MD5: db68b7e724fb0cfdef269c4bc81a8d79
Transpilation MD5: eeeea68551a5dc1eb89aa10f8544cac8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-22 13:06:36
Source code size: 127 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 181 / 273
Version history: 1 change(s)
Referenced in: [show references]