Jump to content

StringRegExp: ".*" eats following character


Recommended Posts

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

Link to comment
Share on other sites

  • 2 weeks later...

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...

Link to comment
Share on other sites

  • 2 weeks later...

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...

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...