I didn't know there was a minimum number of chars. in a player name; I'm sure there is, but as far as I know it
could be a single character.
I still have it messed up though; since everything that matches \d will match \w, the former is unnecessary. Also, the last character should be required once; I'm pretty sure you can't end a player name with a space (that has all sorts of potential for wonkiness, so I would
hope it's not allowed by KoL). So the name matcher should be:
Code:
([a-zA-Z][\\w\\s]{0,28}\\w})
That still puts a floor of 2 characters on a name, but I doubt KoL allows single character names. Actually, I'm still not 100% on knowing what's allowed... anyone with more info, it would be appreciated. The limit of 30 characters is one of the few knows. Also, I like to limit as much as possible, because that avoids bugs in regexes that build with these (ie if this is not the entire matcher, but is PART of one).
Regarding ID's, 90% of the parsing I've done where I wanted to grab ID's was in clan logs, so I think of non-linky ID's as the "norm." I know this isn't true in general on KoL, but it's what I've become used to.
It seems the major disconnect is that I'm looking for a regex as
precise as possible, so it can be flexible enough to be plugged into a matcher along with any possible combination of other strings / characters / saved regexes. You seem to be looking for a regex that is as simple as possible. Both are valid ways to go, IMO, but they tend to be better for different goals. My goal is not the "usual" programmer's goal; it's to make things as simple as possible for other ash scripters who
aren't comfortable with regex.