static List<String> matchAll(String pattern, String text) { List<String> matches = new ArrayList<String>(); Matcher matcher = Pattern.compile(pattern).matcher(text); while (matcher.find()) matches.add(matcher.group()); return matches; }
Snippet is not live.
Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #2000489 |
Snippet name: | matchAll |
Eternal ID of this version: | #2000489/1 |
Text MD5: | 700c6ee22c95c535ca3f9219deaf67cb |
Author: | stefan |
Category: | |
Type: | New Tinybrain snippet |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2015-08-02 19:55:47 |
Source code size: | 268 bytes / 7 lines |
Pitched / IR pitched: | No / Yes |
Views / Downloads: | 572 / 512 |
Referenced in: | #1000734 - find - find object in collection with matching fields / find in text #1002427 - Accellerating 629 (SPIKE) #1004417 - regexpAll return all full matches #3000382 - Answer for ferdie (>> t = 1, f = 0) |