Python regex parsing -


I have an array of strings in Python, in which each string in the array is seeing something like this:

  & lt; Rn = "foo bar" t = "5" s = "10" l = "25" />  

I am searching for a while and the best thing I can do is try to modify the hyperlink regex of HTML that meets my needs.

But really much more regex stuff I really did not know anything was working yet this is that which I have not yet done.

  string = '& lt; Rn = "foo bar" t = "5" s = "10" l = "25" /> Print script ("& lt; r \ s + n = (?: \" (^ \ ") +) \"). *. /? ", String)  

What would be the best way to remove values ​​of n, t, s and l from that string?

You will get most of it from there:

  & gt; & gt; & gt; print rayfandol (r '(\ W ') = "(. *?)"', String) [('n', 'foo bar'), ('t', '5'), ('s',' 10 '),' l ',' 25 ')]  

and are complementary.

Whenever your thought process begins, "I want every item that resembles X." , Then you should use re.findall Hi, "I want data between and around every x", starts with re.split .


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -