Staredit Network Profile-Scene PvT basic
Profile for PvT
Options
Send me a Message
Find my Posts
Find my Topics
Send me Minerals

Last visitors
None.

Account Information
Joined: Aug 28 2007, 6:48 pm
Last Active: Feb 28 2010, 4:53 am
Status: Offline
Display Name: PvT

Statistics
Activity: 9
Posts: 11
Posts Per Day: 0
Topics: 0
Minerals: 0

Contact Information
E-Mail: Lewl coming soon // No spambots

Battle.net
Starcraft I: Not Given.
Starcraft II: Not Given.


Signature
None.
[05:52 pm]
Roy -- poiuy_qwert
poiuy_qwert shouted: Vrael Its because you are only capturing the port, you want something more like '([0-9]+(?:\.[0-9]+){3}(?::[0-9]+)?)'
So this is actually more accurate than I first gave you credit for.
[04:47 pm]
Roy -- As per the docs: The string is scanned left-to-right, and matches are returned in the order found. If one or more groups are present in the pattern, return a list of groups; this will be a list of tuples if the pattern has more than one group.
[04:44 pm]
Roy -- The fix is as simple as making the check for the port be a non-capturing group.
[04:44 pm]
Roy -- According to a quick search, it appears re.findall will return the entire match if there are no other capture groups defined, or an array of each capture group. Since you're capturing :[0-9]+, it returns an array with just that result.
[04:41 pm]
Roy -- Check the documentation for the module you're using; it could be that it's returning the last capture group or something.
[04:40 pm]
Roy -- It returns an array with two matches: the IP+port, and the port.
[04:40 pm]
Roy -- Here's the JS if you don't believe me: console.log('192.168.1.1:80'.match(/[0-9]+(?:\.[0-9]+){3}(:[0-9]+)?/));
[04:39 pm]
Roy -- Vrael
Vrael shouted: in practice that expression only captures ":80"
Testing with the .NET implementation and JavaScript implementation, as well as on Regex Pal, it captures the IP+port.
[04:19 pm]
Fire_Kame -- Tell me, what was demon like before he knew the words "gay" "retarded" and "alcohol"
[04:19 pm]
Fire_Kame -- Or am origin story....
Please log in to shout.


Members Online: Deactivated; testing around! :)