RegEx in python questions

Hello I have been trying to do the timed challenges in JS. I have completed up to 6. I tried doing timed 6 in JS but trying to get the XMLHttpRequest() to get the data off of google is tricky (unless I'm using the wrong function...?) Anyway, I thought it would be practice to try doing it in a different language, so I chose Python.

I can log into the site and get the page data off of timed6/index.php.

side note: I also notice that the word var is not correct but I will fix it later (ex: if word = google then it finds google, but if word = good bye then only bye is found.)

Anyway, when it finds the regex patterns I get:

Code

<_sre.SRE_Match object at 0x00E42368>

How can I print this in the shell so I see the actual word not its location?

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

RE: RegEx in python questions

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

looks neater but stills doesn't grab the spaces if in ex: "denial of service" only gets service.

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

RE: RegEx in python questions

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

if I just do http://www.google.com and store the data its does it fine, but not when I do it with search?q= and the end of it.

Any suggestions?...

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

RE: RegEx in python questions

hmm weird none of them are working. I have tried all the examples, but for some reason it will not take a variable as an integer it reads it as a string. And for some reason my last for loop is not running....

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

print aArray[intNum] #cannot work because its reading intNum as a string

Since I do not know the number right a way nor will it work if I hard code it, I need it to grab the random number that is given. The only way that I know of is to store it in a variable. Which is not hard, but, I need to know how to pass the variable in the index as a integer not a string.

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

RE: RegEx in python questions

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

RE: RegEx in python questions

Ok, I am at the final stage of this challenge, all I need help with now is how to post back the data to the same url.....

do I have to subit another request? (I do not think that would be it right, wouldn't it just grab a new page?)

do I just open the page again and post back? (not sure if python keeps it open or not)

The philosophy of one century is the common sense of the next. -Fortune Cookie

I would like to thank a few friends that I have made here that helped me and deserve to be mentioned:
System_Meltdown, Futility, nvrlivenvrdie, Mastergamer, TrueHacker, S1L3NTKn1GhT, Reelix, ynori7, Demons Halo, kryptor

oh and

Mordak, my long lost brother from across the pond!

Author

RE: RegEx in python questions

Member

Posts:Location:Joined: 01.01.70 Rank: Guest

Posted on 28-07-09 23:13

elmiguel wrote:
Ok, I am at the final stage of this challenge, all I need help with now is how to post back the data to the same url.....

do I have to subit another request? (I do not think that would be it right, wouldn't it just grab a new page?)

do I just open the page again and post back? (not sure if python keeps it open or not)