R
R
root092016-04-01 18:23:08
Regular Expressions
root09, 2016-04-01 18:23:08

How to parse two values ​​at once from a string?

There is a line:

<tr><td>&nbsp;<a href="m.exe?t=4253609_1_2&s1=A">A</a></td><td>&nbsp;<a href="m.exe?t=4253609_2_1">авиалиния, протяжённая преимущественно в направлении север-юг</a> <span STYLE="color:gray">amber airway<span STYLE="color:black"> &nbsp;<a href="m.exe?a=116&&UserName=%D3%E3%EB%EE%E2">(Углов)</a></td></tr>

You need to get two values:
A
and
an airline stretching mainly in the north-south direction amber airway   (Angles)
how to get two values ​​\u200b\u200bfrom a string at once using regex?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2016-04-01
@root09

In a curve, you can do it like this
.*">(.*)<\/a>.*">(.*)<\/a>.*href
( https://regex101.com/r/vU8cU1/1)
And normally, you need to watch the entire html so that there are no problems.
But in general, it is better to use libraries for parsing tags.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question