How do I get the following values in Regex from the following string
<tr><td>4 <td><b><a href="number.php?v=41a&k=53&t=102">3</a></b>
v = 41
k = 45
t = 102
I wanted only the number of each segment (v k t)
I tried this and got only one at a time
v=\d+
If your input string is really as simple as you said, you could use preg_match_all:
$str = '<tr><td>4 <td><b><a href="number.php?v=41a&k=53&t=102">3</a></b>';
preg_match_all('/(?<=[vkt]=)\d+/', $str, $m);
print_r($m[0]);
Output:
Array
(
[0] => 41
[1] => 53
[2] => 102
)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments