Posted in the wrong thread at first, crossposting from LC
Kind of a noob question, but I'm pretty stumped here although it is probably simple.
I am trying to combine certain lines of xml files I have into one ordered document, and trying to search through the file with regular expressions.
Lines I'm searching for look like this or similar:
000101101000101101 -> 000101101110101101
However, I'm always looking for the second binary string as a given, and just want to also find the first string. I store the second string I'm looking for in a string, so something like:
string='000101101000101101 -> 000101101110101101'
want='001001101110101101'
What I then try to do is re.search(r'([01]+).->.'(want), string) but that isn't working. The problem here is that I want to search for that specific binary string that I would like to store in the variable, ánd that I want to store both strings in a tuple group so I can call them later for other stuff.
Any idea how I can fix this?