Sim0n Posted May 9, 2008 Share Posted May 9, 2008 Hi, I want to know how to get the following done: I have a string, like this: blablablablabla blabla hey blaablaablabla bla bla What I want to get done, is to get to the clipboard the word hey and then for example 5 characters, so in this example I want to get the string hey blaab to clipboard. Any ideas? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 9, 2008 Moderators Share Posted May 9, 2008 (edited) Look at StringMid + StringInStr + StringLen or StringRegExp. Edited May 9, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
covaks Posted May 9, 2008 Share Posted May 9, 2008 $str = "blabla hey blaablaablabla bla bla" ClipPut(StringMid($str,StringinStr($str,"hey"),8)) Link to comment Share on other sites More sharing options...
rudi Posted May 9, 2008 Share Posted May 9, 2008 (edited) Hi.clipput() and stringregexp() already were answered for you.For a quick look how results look like try this one:#include <array.au3> $MyString="blablablablabla" & @LF & "blabla hey blaablaablabla hey again bla bla" $MySubStr=StringRegExp($MyString,"(hey .{5})",3) _ArrayDisplay($MySubStr)When starting with regexp don't miss this one:- Help file - Tutorials - String Regular expression (run the StringRegExpGUI.au3 at the bottom of that topic)Regards, Rudi. Edited May 9, 2008 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE! 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