typeleven Posted July 15, 2010 Share Posted July 15, 2010 I feel like I'm missing something very obvious here. I have this line... StringRegExp("tt1234567 tt1231234 4242424","(?:tt)[0-9]{7}",3) and I get this result (as an array): tt1234567 tt1231234 but shouldnt I get this? 1234567 1231234 I want to strip out that "tt" and only get things that started with "tt" in the string. Link to comment Share on other sites More sharing options...
Mat Posted July 16, 2010 Share Posted July 16, 2010 (edited) Because you have no matching groups, the whole match is returned. You want to return a group that contains [0-9]{7}, so group it Because you've done that, you don't need to have a non-matching group for the tt.StringRegExp("tt1234567 tt1231234 4242424","tt([0-9]{7})",3)I hope you can understand that... I seem to be talking complete gobbledegook when it comes to explaining programming in words, I was showing my design for a new cricket club website to the first team captain, and after explaining the whole way the database is structured for comments he said "So a bit like facebook then?", I could have said "You can comment a bit like facebook." and that would be all Mat Edited July 16, 2010 by Mat AutoIt Project Listing 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