I have a problem with regular expression. I have this code:
<div class="textPremium">Premium Access 25.04.2014 | 20:59<br>Server: ON | Bandwidth: 200MB<br /></div>
I want to match:
"25.04.2014" (date)
"20:59" (time)
"200" (bandwidth)
Here is my regular expression:
<div class=\"textPremium\">Premium Access (.*) \| (.*)<br>Server: ON | Bandwidth: (.*)MB<br><\/div>
I matched the date and time, but I can't match bandwidth. Adding \
before |
doesn't work.
` and you are matching `Bandwidth: (.*)MB
` (**note the `
`**). This is why you shouldn't use regular expressions to match HTML (because HTML isn't a regular language). – Sam Apr 25 '14 at 16:53
Server: ON \| Bandwidth: (.*)MB
<\/div>`