weaponx Posted March 4, 2008 Share Posted March 4, 2008 (edited) #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.10.0 Author: WeaponX Script Function: Split string on regular expression Parameters: String = String to be split Pattern = Pattern to split on IncludeMatch = True / False - Indicates whether or not to include the match in the return (back-reference) Count = Number of splits to perform #ce ---------------------------------------------------------------------------- Func _StringSplitRegExp($sString, $sPattern, $sIncludeMatch = false, $iCount = 0) ;All matches will be replaced with this string Local $sReservedPattern = Chr(0) Local $sReplacePattern = $sReservedPattern ;Modify the reserve pattern to include back-reference If $sIncludeMatch Then $sReplacePattern = "$0" & $sReplacePattern ;Replace all occurences of the search pattern with a replace string $sTemp = StringRegExpReplace($sString, $sPattern, $sReplacePattern, $iCount) ;Strip trailing character if it matches the reserved pattern If StringRight($sTemp, 1) = $sReservedPattern Then $sTemp = StringTrimRight($sTemp, 1) ;Split string using entire reserved string $aResult = StringSplit($sTemp, $sReservedPattern, 1) Return $aResult EndFuncoÝ÷ ØLZ^±«¢+Ø¥¹±Õ±ÐíÉÉä¹ÔÌÐì((íMÁ±¥Ð¥¹Ñ¼Á¥ÉÌ¡lÁtôÜ°lÅtô°lÉtô°lÍtô°lÑtô°lÕtô°lÙtô°lÝtô¤(ÀÌØíÍÑÉ¥¹ÄôÅÕ½ÐíÅÕ½Ðì(ÀÌØíÉÍÕ±ÐÄô}MÑÉ¥¹MÁ±¥ÑIáÀ ÀÌØíÍÑÉ¥¹Ä°Ìäì ¸¥ìÉôÌäì°ÑÉÕ¤(í}ÉÉå¥ÍÁ±ä ÀÌØíÉÍÕ±ÐÄ°ÅÕ½Ðí1ÑÑÈÁ¥ÉÌÅÕ½Ðì¤((íMÁ±¥Ð¡Í ±¥µ¥Ñ¤¡lÁtôÜ°lÅtô°lÉtô°lÍtô°lÑtô°lÕtô°lÙtô°lÝtô¤(ÀÌØíÍÑÉ¥¹ÈôÅÕ½ÐíµµµµµµÅÕ½Ðì(ÀÌØíÉÍÕ±ÐÈô}MÑÉ¥¹MÁ±¥ÑIáÀ ÀÌØíÍÑÉ¥¹È°Ìäì ´¤Ìäì¤(í}ÉÉå¥ÍÁ±ä ÀÌØíÉÍÕ±ÐÈ°ÅÕ½Ðí1ÑÑÈÁ¥ÉÌ°ÍÁ±¥ÐäÍ ÅÕ½Ðì¤((íMÁ±¥Ð¡µ¥Í±±¹½Õ̱¥µ¥Ñ¤¡lÁtôÜ°lÅtô°lÉtô°lÍtô°lÑtô°lÕtô°lÙtô°lÝtô¤(ÀÌØíÍÑÉ¥¹ÌôÅÕ½ÐíÌÌíÀÌØíyµÀíÅÕ½Ðì(ÀÌØíÉÍÕ±ÐÌô}MÑÉ¥¹MÁ±¥ÑIáÀ ÀÌØíÍÑÉ¥¹Ì°Ìäímylé±¹Õ´éutÌäì¤(í}ÉÉå¥ÍÁ±ä ÀÌØíÉÍÕ±ÐÌ°ÅÕ½Ðí1ÑÑÈÁ¥ÉÌ°ÍÁ±¥ÐäÙÉ¥½Õ̱¥µ¥ÑÉÌÅÕ½Ðì¤((íMÁ±¥Ð¡ÕÁÁÉͱ¥µ¥Ñ¤¡lÁtôÜ°lÅtô°lÉtô°lÍtô°lÑtô°lÕtô°lÙtô°lÝtô¤(ÀÌØíÍÑÉ¥¹ÐôÅÕ½Ðí ÅÕ½Ðì(ÀÌØíÉÍÕ±ÐÐô}MÑÉ¥¹MÁ±¥ÑIáÀ ÀÌØíÍÑÉ¥¹Ð°ÌäímléÕÁÁÈéutÌäì¤(í}ÉÉå¥ÍÁ±ä ÀÌØíÉÍÕ±ÐаÅÕ½Ðí1ÑÑÈÁ¥ÉÌ°ÍÁ±¥ÐäÕÁÁÈͱÑÑÉÌÅÕ½Ðì¤((íMÁ±¥Ðչѥ½¸½±Í͹µ¥¹Ñ¼Ý½ÉÌ¡lÁtôаlÅtôQ¡¥Ì°lÉtô%Ì°lÍtô°lÑtôQÍФ(ÀÌØíÍÑÉ¥¹ÔôÅÕ½ÐíQ¡¥Í%ÍQÍÐÅÕ½Ðì(ÀÌØíÉÍÕ±ÐÔô}MÑÉ¥¹MÁ±¥ÑIáÀ ÀÌØíÍÑÉ¥¹Ô°ÌäímµhÀ´åumyµit¨Ìäì°ÑÉÕ¤(í}ÉÉå¥ÍÁ±ä ÀÌØíÉÍÕ±ÐÔ°ÅÕ½ÐíMÁ±¥Ðչѥ½¸½±Í͹µ¥¹Ñ¼Ý½ÉÌÅÕ½Ðì¤((íMÁ±¥ÐÁÉÉÁ ¥¹Ñ¼Í¹Ñ¹Ì¡ÙÉ¥½ÕÌÁÕ¹ÑÕÑ¥½¸¤¡lÁtôÔ°lÅtôᱵѥ½¸ÌÌì°lÉtô±±¥Á̸ͥ¸¸°lÍtô͹ѹ½¹Ñ¥¹Õ¸°lÑtô5¥ÍÍ¥¹ÑÉ¥±¥¹ÍÁ¸°lÕtôEÕÍÑ¥½¸ü¤(í9=QèQ¡¥Ì¹Ìµ½Éݽɬ¸Ù±¥Í¹Ñ¹Í¡½Õ±±±½ÝѼ¹Ý¥Ñ µ¥à½ÅÕÍÑ¥½¸µÉ̬ᱵѥ½¸Á½¥¹ÑÌÕб±¥ÁÍ¥ÌÍ¡½Õ±¹½ÐµÉ¬ÍÁ±¥Ð(ÀÌØíÍÑÉ¥¹ØôÅÕ½Ðíᱵѥ½¸ÌÌì±±¥Á̸ͥ¸¹Í¹Ñ¹½¹Ñ¥¹Õ¸5¥ÍÍ¥¹ÑÉ¥±¥¹ÍÁ¹EÕÍÑ¥½¸üÅÕ½Ðì(ÀÌØíÉÍÕ±ÐØô}MÑÉ¥¹MÁ±¥ÑIáÀ ÀÌØíÍÑÉ¥¹Ø°Ìäì ÀäÈì¹ðÌÌíðÀäÈìü¤ üÌÌìÀäÈ츤Ìäì°ÑÉÕ¤)}ÉÉå¥ÍÁ±ä ÀÌØíÉÍÕ±ÐØ°ÅÕ½ÐíMÁ±¥Ð¥¹Ñ¼Ý½ÉÌÅÕ½Ðì¤ Edited May 19, 2008 by weaponx Link to comment Share on other sites More sharing options...
goldenix Posted March 4, 2008 Share Posted March 4, 2008 oo this is pure gold thanx My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list] Link to comment Share on other sites More sharing options...
weaponx Posted May 19, 2008 Author Share Posted May 19, 2008 Examples updated. Link to comment Share on other sites More sharing options...
Newb Posted August 20, 2012 Share Posted August 20, 2012 I would like to see some examples, because you told you updated them but I don't see anything... I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it. Link to comment Share on other sites More sharing options...
guinness Posted August 21, 2012 Share Posted August 21, 2012 Considering the user hasn't been around for a long time you're unlikely to get a response and secondly it's pretty simple to figure out yourself since it's like StringSplit. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 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