n9mfk9 Posted January 8, 2008 Share Posted January 8, 2008 Hi all I need some help With some RegExp pattern I try to use for an other program language but i can not find what wood do the same in autoit s Treat string as single line m Treat string as multiple lines g Global matching, and keep the Current position after failed thanks beau Link to comment Share on other sites More sharing options...
weaponx Posted January 8, 2008 Share Posted January 8, 2008 Hi all I need some help With some RegExp pattern I try to use for an other program language but i can not find what wood do the same in autoit sTreat string as single linemTreat string as multiple linesgGlobal matching, and keep the Current position after failedthanks beauI'm not sure what you need but there is definitely a subliminal message in there.s = Sarahm = Michelleg = Gellar Link to comment Share on other sites More sharing options...
n9mfk9 Posted January 8, 2008 Author Share Posted January 8, 2008 I'm not sure what you need but there is definitely a subliminal message in there.s = Sarahm = Michelleg = Gellar no subliminal message in there I am look at a perl program an trying to do it in autoit Link to comment Share on other sites More sharing options...
BrettF Posted January 8, 2008 Share Posted January 8, 2008 Could you give us an example line and what you want to return? Also the current RegExp pattern you are using. That would help so much... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
MrCreatoR Posted January 8, 2008 Share Posted January 8, 2008 Hi,Treat string as single lineBy default $ means end of string, so if you use it at the end of the pattern, it will be as one line You can read about AutoIt RegExp methods in the help file (Online Documentations).  Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1  AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ==================================================    AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
n9mfk9 Posted January 8, 2008 Author Share Posted January 8, 2008 an example %this part could be text or numbers or symbol% no mater what there is a% an at the end Beau Link to comment Share on other sites More sharing options...
weaponx Posted January 8, 2008 Share Posted January 8, 2008 Look in the help file. #include <String.au3> _StringBetween ( $sString, $sStart, $sEnd [, $vCase [, $iSRE ]] ) Link to comment Share on other sites More sharing options...
n9mfk9 Posted January 9, 2008 Author Share Posted January 9, 2008 hi everyone is there a way if i have a string of text with %any thing in here% more text her how can i take just this part out %any thing in here% thanks beau Link to comment Share on other sites More sharing options...
Fossil Rock Posted January 9, 2008 Share Posted January 9, 2008 (edited) ([%]+(.)+[%])This will grab whatever is between the %'s, but it also grabs the %'s. I'm an amateur at SRE, so there may be a way to strip the %'s as well.Example: This line is %used as an& example....Results: %used as an% Edited January 9, 2008 by Fossil Rock Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
n9mfk9 Posted January 9, 2008 Author Share Posted January 9, 2008 here some test code i tried it still leaves out % % thanks for any help Beau #include <String.au3> #include <array.au3> $file = FileOpen("mylist.txt", 0) ;Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $aArray1 = _StringBetween($line, '%', '%',-1,'([%]+(.)+[%])') _ArrayDisplay($aArray1, 'StringRegExp Search') If Not @error Then EndIf WEnd ;FileClose($fileout) FileClose($file) Link to comment Share on other sites More sharing options...
weaponx Posted January 9, 2008 Share Posted January 9, 2008 What do you mean it leaves out % and %? If you need those on the string just append them to the found match. $var = "%" & $var & "%" 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