i'm breaking my head to find a solution for this.

I need catch some specific values in a string. This string had this format before a treatment:

```
5593 DSR Sobreaviso   [ 032]   0,00 54,38
01 SRM Sim            [  01]        10,00

```

After the treatment, the string will be like this:

```
5593 DSR Sobreaviso [ 032] 0,00 54,38 01 SRM Sim [  01] 10,00

```

So.. i need catch the most right values, which is the total, and i'm having a hard time to figure it out how to extract the second value if the first value exist, and extract the first value if the second value doesn't exist.

I'm trying like this:

```
/.*?\s(?:5593)\s.*?\s([\d.,]+)]\s([\d.,]+)/

```

I need explicity pass the most right value because this pieces are inside a huge text (more than 50k words).

Checkout this example: <http://regexr.com/3cj6e>

When i pass 5593, the regex will catch the 0,00, but i need the 54,38.. when i pass 01, the regex will catch the right value.

Thanks.