Qousio Posted June 7, 2009 Posted June 7, 2009 (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 June 7, 2009 by Qousio
MrMitchell Posted June 7, 2009 Posted June 7, 2009 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
Qousio Posted June 7, 2009 Author Posted June 7, 2009 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 thatThanks allot, works perfectly
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now