skip to Main Content

can you help please:
i want to get the adress from that text using python:

 [RIPH] harambe protocol

First alert listed in this telegram group 637 seconds before anyone else.

Coin name:    harambe protocol
Address:         0x10964C2ffDEA1e99B5e26D102516d9b03368915f
Platform:        BSC
Time:               08:02:58 UTC

2

Answers


  1. try this:

    import re
    
    pattern = "Address:.*(0x.*)"
    
    address = re.findall(pattern, your_text, re.MULTILINE)
    
    print(address)
    
    
    Login or Signup to reply.
  2. Would you please try the following:

    #!/usr/bin/python
    
    import re
    
    with open('textfile') as f:
        for line in f:
            m = re.search(r'Address:s*(0[xX][0-9A-Fa-f]+)', line)
            if (m):
                print(m.group(1))
    

    Output:

    0x10964C2ffDEA1e99B5e26D102516d9b03368915f
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search