ElektroStudios
ElektroStudios

Reputation: 20474

Design regex expression for this html

In this html line:

<b>Cash Out: </b> 2.46x </p> <p> <b>Played: </b>Sat Ene 12 2015 00:20:13

How I could match the 2.46x value?

This is the expression that I've tried to design:

"(cash.+out.+\s+)([\d\.]+[^\s])"

PS: I know that RegEx motor was not designed to parse Html, but anyways it can be done so please avoid that kind of comments since also I'm using a limited language for this task, VisualBasicScript.

Upvotes: 2

Views: 37

Answers (1)

Wiktor Stribiżew
Wiktor Stribiżew

Reputation: 627262

Your regex matches <b>Cash Out: </b> 2.46x </p> <p> <b>Played: </b>Sat Ene 12 2015, right? I'd suggest narrowing it down to after the closing tag + space.

Try this: cash.+out.+\s+<\/\w+>\s+([\d\.]+x)

The value you are looking for will be in the first submatch.

Upvotes: 1

Related Questions