Jump to content

Recommended Posts

Posted (edited)

Hello!

I need to stringregexp a string that looks like this: value1: |01.23|

Soo, I have used this StringRegExp($text, 'value1: \V\d\d\V\d\d', 1)

And it works fine, the problem is, sometimes theres one number instead of two, so its |0.1|, in that case the above doesnt work.

Using strinlen to find out how many numbers there are wouldnt work either, because it could be 00.1 or 0.11 etc.

Edited by Qousio
Posted

There are other ways, but you could just replace the second \d with {1,2}.

StringRegExp($text, 'value1: \V\d{1,2}\V\d{1,2}', 1)

Something like that

Thanks allot, works perfectly :D

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
  • Recently Browsing   0 members

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