• Welcome to Valhalla Legends Archive.
 

Regex for Capturing user details

Started by MyndFyre, July 19, 2009, 04:12 PM

Previous topic - Next topic

MyndFyre

Quote from: Camel on August 03, 2009, 03:19 PM
I don't really have time to read the thread in detail right now, but it looks like you're missing at least one gateway: @Blizzard (check out #Blizzard Tech Support on USWest), and are assuming that 'instance' can only be one digit, which is definitely false. A good test case might be W@R@Blizzard#101, which should break on both fronts with your second regex.

Not sure if this helps, but in my bot I force the user to pick one of the *.battle.net named servers, and then use that information to infer the logged in user's gateway, and subsequently validate other users' names.
With your example, the first regex in the updated post above correctly matches W@R@Blizzard#101.  I used brackets to indicate repetition in the instance: \d{1,9} means anywhere from 1 to 9 instances of digit.  The second regex would match W@R@Blizzard as the account name.

But yes, it would probably be better for me to explicitly capture @Blizzard along with the other ones.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.