Sign in to follow this  
Followers 0
AyJay

Help about strings..

12 posts in this topic

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.

Share this post


Link to post
Share on other sites



#3 ·  Posted (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 by AyJay

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

ahh yes, now it does spaces all letters, thanks again.

Share this post


Link to post
Share on other sites

hmm, how do u do Letters and digits?

i tried [:alnum:] but no luck, or maybe im doing it wrong..

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks, it works perfectly.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0