December 30, 20195 yr A-Za-z -> A-z Also, don't post pictures of code. Also, show examples of text that needs to be matched (both positives, false positives, and false negatives). Edited December 30, 20195 yr by Draco18s Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
December 30, 20195 yr Your examples have a character after the players name, but the regex isn't looking for it. This may work for you (its basically what you had but shortened and captures the character at the end): "\\w+ [ |\\w]+ (by|of|to|for) " + Minecraft.getMinecraft().thePlayer.getName() + "." Or this one if you want to use capture groups to grab the name to keep track of how often a player is killed "(\\w+) [ |\\w]+ (by|of|to|for) " + Minecraft.getMinecraft().thePlayer.getName() + "." I use this url when working with regex: https://regex101.com If that still doesn't work you'll want to verify the messages received are in the format you expect.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.