AyJay Posted November 24, 2006 Share Posted November 24, 2006 i have a string that is 11111111111111111111 11111111111111111111 11111111111111111111 in an edit box for example, and when i click a button, i want it to display 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 in the edit box, how would i do that? Thanks. Link to comment Share on other sites More sharing options...
Uten Posted November 24, 2006 Share Posted November 24, 2006 Somthing like this: $newdata = StringRegExpReplace($data, "(\d{2})", "\1 ") Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
AyJay Posted November 24, 2006 Author Share Posted November 24, 2006 (edited) umm, can you explain how that works? and how do u do it for other numbers? like '12345678900987654321'. i tried searching for it in the help file, but no topics, might be old hh. Edited November 24, 2006 by AyJay Link to comment Share on other sites More sharing options...
Uten Posted November 24, 2006 Share Posted November 24, 2006 Grab a beta newer than 3.2.1.8 ( I think) StringRegExp And StringRegExpReplace was out for a while. Depending on how old your version of autoit you have it should work. If you cant find it in the help file you have to go to the online docs (but be warned the regexp engine has changed). \d matches digits. So you get a match everytime you have to digits. The two digits are placed in \1 so the replace string will give you two digits and a space. Then there is some global searching flags you have to figure out and probably a descission to make about an array. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
AyJay Posted November 25, 2006 Author Share Posted November 25, 2006 ahh yes, now it does spaces all letters, thanks again. Link to comment Share on other sites More sharing options...
AyJay Posted November 25, 2006 Author Share Posted November 25, 2006 hmm, how do u do Letters and digits? i tried [:alnum:] but no luck, or maybe im doing it wrong.. Link to comment Share on other sites More sharing options...
theguy0000 Posted November 25, 2006 Share Posted November 25, 2006 you should be using something like this $newdata = StringRegExpReplace($data, "([:alnum:]{2})", "\1 ") The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
AyJay Posted November 25, 2006 Author Share Posted November 25, 2006 doesn't seem to make any spaces though. [:alnum:] is the same as /w and /d together. so how do u just do /w and /d? Link to comment Share on other sites More sharing options...
theguy0000 Posted November 25, 2006 Share Posted November 25, 2006 this seems to work....... $newdata = StringRegExpReplace($data, "(\d{2}|\w{2})", "\1 ") The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
AyJay Posted November 25, 2006 Author Share Posted November 25, 2006 Thanks, it works perfectly. Link to comment Share on other sites More sharing options...
theguy0000 Posted November 25, 2006 Share Posted November 25, 2006 Thanks, it works perfectly.welcome The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Uten Posted November 25, 2006 Share Posted November 25, 2006 Try with: [a-zA-Z0-9] Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling 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