1 | static List<String> matchAll(String pattern, String text) {
|
2 | List<String> matches = new ArrayList<String>(); |
3 | Matcher matcher = Pattern.compile(pattern).matcher(text); |
4 | while (matcher.find()) |
5 | matches.add(matcher.group()); |
6 | return matches; |
7 | } |
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: | 802 / 560 |
| Referenced in: | [show references] |