I have a line of text in the form \" some spaces variable = 7 = \'0x07\' some more data\"
\" some spaces variable = 7 = \'0x07\' some more data\"
I want to parse it and get the number 7 from \
Use a regular expression.
Essentially, you create an expression that goes something like "variable = (\d+)", do a match, and then take the first group, which will give you the string 7. You can then convert it to an int.
"variable = (\d+)"
Read the tutorial in the link above.