Jump to content

Recommended Posts

Posted (edited)

On lines like

balblabla = 84.99.34.3
StringRegExp($Line, ".*(\d+\.\d+\.\d+\.\d+)", 1)
is returning "4.99.34.3"
StringRegExp($Line, ".*( \d+\.\d+\.\d+\.\d+)", 1)
is returning " 84.99.34.3"
StringRegExp($Line, ".*(\d*\.\d+\.\d+\.\d+)", 1)
is returning ".99.34.3"

Strange, isn't it! Is it a bug :)

Edited by mdes

Gestion des congés, RTT, vacances scolaires, autres absences sur Pocket PC : CongésRFV

  • 2 weeks later...
Posted

I will check this one out as well, then. Thanks for the feedback.

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

  • 2 weeks later...
Posted

The behaviour I got is what is shown above and is the correct behaviour for the patterns specified.

The key here is that .* collects as many characters as possible, that still allows the following pattern to work. The choose smaller selections, put a question mark (?) after the splat (*).

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Posted

When I've tried this, it failed for me as well. Specifically if you do something like xyz.*(abc) the .* is too greedy and always eats everything until the eol.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...