kylomas Posted September 16, 2014 Posted September 16, 2014 @mikell - I changed over to '[^rn]+'...much cleaner... Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
Malkey Posted September 16, 2014 Posted September 16, 2014 (edited) Local $a1 = StringRegExp($str, '.+', 3)And cleaner and cleaner.To create blank rows in the array from blank lines in the string. And, not create a blank row at the end of the array regardless of a trailing line feed in string.Then this appears to work.Local $a1 = StringRegExp($str, '(.*)(?:\R)|.+$', 3)Edit: Changed from '(.*(?:R)|.+$)', because the outside capture group, (....), is capturing the non-capture group, (?:R), causing the line feeds to exist in the array elements. Edited September 19, 2014 by Malkey
Malkey Posted September 19, 2014 Posted September 19, 2014 does (?:R) mean excluding the enter line? Yes. The "R" is matched in the test string, but is not captured. That is, the line feed will not appear in the result of the Reg Exp. function. See my post#22 Edit. However, this "(?:R)" non-capture group can be captured if enclosed within a capture group as I mistakenly did in post #22.
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