TheQuack45

Java regex - does not work?

Nov 14th, 2014
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. // postText is value at "selftext" here: https://www.reddit.com/api/info.json?id=t3_2gavo6
  2.  
  3. String[] regexArr = postText.split("\\*\\*Minecraft[\\s\\w]{1,}:\\*\\* DEATH HYPE \\d{1,}\\.\\d{1,}");
  4. String regexLine = regexArr[1];
  5.  
  6. // Line 4 throws "java.lang.ArrayIndexOutOfBoundsException", so I assume it's saying the regex did not work correctly, even though it does on regex101.com
Advertisement
Add Comment
Please, Sign In to add comment