Jump to content
UBot Underground

LearningNewbie

Members
  • Content Count

    2
  • Joined

  • Last visited

Community Reputation

0 Neutral

About LearningNewbie

  • Rank
    Newbie

System Specs

  • OS
    Windows 10
  • Total Memory
    8Gb
  • Framework
    unsure
  • License
    Professional Edition

Recent Profile Visitors

1303 profile views
  1. Hi! I want to store the numbers in a variable be it positive or negative! I've tried this: For example This is the data in a list. data = [u'\x1b[0m[\x1b[1m\x1b[0m\xbb\x1b[0m\x1b[36m]\x1b[0m (A=-5,B=5)', u'\x1b[0m[\x1b[1m\x1b[0m\xbb\x1b[0m\x1b[36m]\x1b[0m (A=5,Y=5)', u'\x1b[0m[\x1b[1m\x1b[10m\xbb\x1b[0m\x1b[36m]\x1b[0m : '] How do I extract the integer values of A and B (negative and positive) and store them in a variable so that I can work with the numbers? I tried smth like this but the list is empty .. for line in data[0]: pattern = re.compile("([A-Z]=(-?\d+?),[A-Z]=(-?\d+?))") store =
  2. Hey guys! I am new to learning regex in python and I'm wondering how do I use regex in python to store the integers(positive and negative) i want into a list! For e.g. This is the data in a list. [u'\x1b[0m[\x1b[1m\x1b[0m\xbb\x1b[0m\x1b[36m]\x1b[0m (A=-5,B=5)', u'\x1b[0m[\x1b[1m\x1b[0m\xbb\x1b[0m\x1b[36m]\x1b[0m (A=5,Y=5)', u'\x1b[0m[\x1b[1m\x1b[10m\xbb\x1b[0m\x1b[36m]\x1b[0m : '] How do I extract the values of A and B and store them in a variable I want using regex? Thank you and appreciate it
×
×
  • Create New...