LxP Posted October 30, 2005 Share Posted October 30, 2005 (edited) Hi guys,Here's some code:#Include <Array.au3> Local $TestCase1 = ' This line starts with some spaces' Local $TestCase2 = 'This line starts with no spaces' Local $RegExp = '^(\s*)(\w+)' Local $Results1 = StringRegExp($TestCase1, $RegExp, 1) Local $Results2 = StringRegExp($TestCase2, $RegExp, 1) _ArrayDisplay($Results1, '$Results1') _ArrayDisplay($Results2, '$Results2')Here's the output I expect:[0] = (some spaces)[1] = This[0] = (empty element)[1] = ThisHere's what I'm receiving:[0] = (some spaces)[1] = This[0] = ThisIf StringRegExp() is asked to 'return an array with the text that matched all the group patterns' (i.e. flag 1) then is it fair to expect that the returned array contain as many elements as there are groups? With the current behaviour it is not possible to determine which element matches which group if not all groups return data. Edited October 30, 2005 by LxP Link to comment Share on other sites More sharing options...
peethebee Posted October 30, 2005 Share Posted October 30, 2005 Hi! There are several problems with StringRegExp(). Have a look at the bugs forum and make sure to use the latest beta. peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Link to comment Share on other sites More sharing options...
LxP Posted October 30, 2005 Author Share Posted October 30, 2005 I had a quick look at the open StringRegExpReplace()-related bugs and if this could be classified as a bug then I think it would be a new one.I'm not sure if it is regarded as buggy behaviour though, so I thought I should post here first. Link to comment Share on other sites More sharing options...
Valik Posted October 30, 2005 Share Posted October 30, 2005 LxP, I think things should behave as you describe so I would report it as a bug. Link to comment Share on other sites More sharing options...
LxP Posted October 31, 2005 Author Share Posted October 31, 2005 Thanks Valik. Reported. Link to comment Share on other sites More sharing options...
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