Jump to content
Sign in to follow this  
m1975michael

StringRegExpReplace Help

Recommended Posts

m1975michael

First I am fairly new to regular expressions but I am learning.

I have a comma delimited file.

$res = StringRegExpReplace($res, "^(?:(?<01>[^,\n]+),)(?:(?<02>[^,\n]+),)(?:(?<03>[^,\n]+),)(?:(?<04>[^,\n]+),)(?:(?<05>[^,\n]+),)(?:(?<06>[^,\n]+),)(?:(?<07>[^,\n]+),)(?:(?<08>[^,\n]+),)(?:(?<09>[^,\n]+),)(?<10>[^,\n]+)(\r\n)*$", "\10")

The regular expression matches each comma delimited section.  The issue I am running into is it only replaces the first line.  I see in the help the (?m) is used for multiple lines but I am not sure how to use it properly.

Using this http://regex101.com/ website as a test with the global and multiple line options it matches multiple lines.

Any assistance would be greatly appreciated.  Thank You!

Edited by m1975michael

Share this post


Link to post
Share on other sites
FireFox

Does it work ?

$res = StringRegExpReplace($res, "(?m)^(?:(?<01>[^,\n]+),)(?:(?<02>[^,\n]+),)(?:(?<03>[^,\n]+),)(?:(?<04>[^,\n]+),)(?:(?<05>[^,\n]+),)(?:(?<06>[^,\n]+),)(?:(?<07>[^,\n]+),)(?:(?<08>[^,\n]+),)(?:(?<09>[^,\n]+),)(?<10>[^,\n]+)(\r\n)*$", "\10")
;or
$res = StringRegExpReplace($res, "^(?m)(?:(?<01>[^,\n]+),)(?:(?<02>[^,\n]+),)(?:(?<03>[^,\n]+),)(?:(?<04>[^,\n]+),)(?:(?<05>[^,\n]+),)(?:(?<06>[^,\n]+),)(?:(?<07>[^,\n]+),)(?:(?<08>[^,\n]+),)(?:(?<09>[^,\n]+),)(?<10>[^,\n]+)(\r\n)*$", "\10")
Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
m1975michael

 

Does it work ?

$res = StringRegExpReplace($res, "(?m)^(?:(?<01>[^,\n]+),)(?:(?<02>[^,\n]+),)(?:(?<03>[^,\n]+),)(?:(?<04>[^,\n]+),)(?:(?<05>[^,\n]+),)(?:(?<06>[^,\n]+),)(?:(?<07>[^,\n]+),)(?:(?<08>[^,\n]+),)(?:(?<09>[^,\n]+),)(?<10>[^,\n]+)(\r\n)*$", "\10")
;or
$res = StringRegExpReplace($res, "^(?m)(?:(?<01>[^,\n]+),)(?:(?<02>[^,\n]+),)(?:(?<03>[^,\n]+),)(?:(?<04>[^,\n]+),)(?:(?<05>[^,\n]+),)(?:(?<06>[^,\n]+),)(?:(?<07>[^,\n]+),)(?:(?<08>[^,\n]+),)(?:(?<09>[^,\n]+),)(?<10>[^,\n]+)(\r\n)*$", "\10")

The first one works except now it skips the first line.  :)  If you have a suggestion on that would be great.  Thank you for the quick response.

Share this post


Link to post
Share on other sites
FireFox

Can you show the string to test on and the desired result?


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
m1975michael

Can you show the string to test on and the desired result?

 

Company,LocationNo,LocationName,LocationDBA,IsActive,LocationManager,LocationPhoneNo,LocationPhoneExtn,LocationFaxNo,LocationMailingAddress,LocationShippingAddress

DDD,9999,Pacific Region,Company Name,Y,LName: FName R.,555-555-5555,&nbsp;,000-000-0000,5555 Westridge Drive<br />Suite 260<br />City<br />IN<br />55555

 

LocationMailingAddress,LocationShippingAddress

5555 Westridge Drive<br />Suite 260<br />City<br />IN<br />55555

Obviously the data is changed to conceal private info.

Share this post


Link to post
Share on other sites
FireFox

$s = "Company,LocationNo,LocationName,LocationDBA,IsActive,LocationManager,LocationPhoneNo,LocationPhoneExtn,LocationFaxNo,LocationMailingAddress,LocationShippingAddress" & @CrLf & _
"DDD,9999,Pacific Region,Company Name,Y,LName: FName R.,555-555-5555,&nbsp;,000-000-0000,5555 Westridge Drive<br />Suite 260<br />City<br />IN<br />55555"

ConsoleWrite(StringRegExpReplace($s, "(?m)^(?:(.*?),){9}", "") & @Lf)


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
mikell

The non-capturing group is not necessary

StringRegExpReplace($s, "(?m)^(.*?,){9}", "")

Share this post


Link to post
Share on other sites
guinness

The intial regexp was quite large for someone who is a newbie.

PS Nice RegExp online tester.

Edited by guinness

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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
FireFox

The non-capturing group is not necessary

Oh don't put me down, I know I suck at regexps :P


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
m1975michael

The intial regexp was quite large for someone who is a newbie.

PS Nice RegExp online tester.

 

Google search helps  :)

Share this post


Link to post
Share on other sites
guinness

Good to know.


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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Share this post


Link to post
Share on other sites
m1975michael

I have another Regex question separate from the one previous.   

The following is what I have come up with so far for the regex expression.  I would like to delete all text except the title and the ID or copy the title and ID into a separate file.  I am not sure how to delete all of the other text or copy just the title and ID information.  I have several files that I would like to open and perform this same task.  The files are different so I can't just make a template replace text or copy the text.

$res = StringRegExpReplace($sDir, "(<title>)(.*)(<\/title>)|(<id>)(.*)(<\/id>)", "\2 \5")
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<movie>
  <fileinfo>
    <streamdetails>
      <video>
        <width>320</width>
        <height>240</height>
        <aspect>1.33</aspect>
        <codec>WMV2</codec>
        <durationinseconds>48</durationinseconds>
        <bitrate>185 Kbps</bitrate>
        <bitratemode>Constant</bitratemode>
        <container>.mkv</container>
      </video>
      <audio>
        <language>Error</language>
        <codec>WMA</codec>
        <channels>2</channels>
        <bitrate>40.0 Kbps</bitrate>
      </audio>
    </streamdetails>
  </fileinfo>
  <title>16 Blocks</title>
  <originaltitle>16 Blocks</originaltitle>
  <alternativetitle>16 calles</alternativetitle>
  <alternativetitle>16 blocs</alternativetitle>
  <alternativetitle>16 Quadras</alternativetitle>
  <alternativetitle>16 rues</alternativetitle>
  <alternativetitle>16 calles</alternativetitle>
  <alternativetitle>16 blocs</alternativetitle>
  <alternativetitle>16 blokova</alternativetitle>
  <alternativetitle>16 utca</alternativetitle>
  <alternativetitle>16 Rehovot</alternativetitle>
  <alternativetitle>Solo 2 ore</alternativetitle>
  <alternativetitle>16 kvartalu</alternativetitle>
  <alternativetitle>16 przecznic</alternativetitle>
  <alternativetitle>16 blokova</alternativetitle>
  <alternativetitle>16 blok</alternativetitle>
  <alternativetitle>Sixteen Blocks</alternativetitle>
  <alternativetitle>Muerte súbita</alternativetitle>
  <sorttitle>16 Blocks</sorttitle>
  <year>2006</year>
  <premiered>2006-03-03</premiered>
  <rating>6.6</rating>
  <votes>97,478</votes>
  <top250>0</top250>
  <outline>An aging cop is assigned the ordinary task of escorting a fast-talking witness from police custody to a courthouse. There are however forces at work trying to stop prevent them from making it.</outline>
  <plot>Jack Mosley, a burnt-out detective, is assigned the unenviable task of transporting a fast-talking convict from jail to a courthouse 16 blocks away. However, along the way he learns that the man is supposed to testify against Mosley's colleagues, and the entire NYPD wants him dead. Mosley must choose between loyalty to his colleagues and protecting the witness, and never has such a short distance seemed so long...</plot>
  <tagline>1 Witness... 118 Minutes...</tagline>
  <country>Germany</country>
  <thumb aspect="poster">http://image.tmdb.org/t/p/original/wpKBLDjNRddmH6N32ni4bASogt8.jpg</thumb>
  <thumb aspect="poster">http://image.tmdb.org/t/p/original/50L7MaiHGWoEmrd1Gfy3GsBi39Y.jpg</thumb>
  <thumb aspect="poster">http://image.tmdb.org/t/p/original/foCWsNPMWwZWqPVSIHdydA3bGBT.jpg</thumb>
  <thumb aspect="poster">http://image.tmdb.org/t/p/original/31xr6dXups2uGC9VwCHBIq6klCp.jpg</thumb>
  <thumb aspect="poster">http://image.tmdb.org/t/p/original/zYAc8S0DzeJ1USQcj4F9bJ34Bbr.jpg</thumb>
  <thumb aspect="poster">http://image.tmdb.org/t/p/original/pl6LEL7MvgwXwls9TgmsVASvWx4.jpg</thumb>
  <thumb aspect="poster">http://image.tmdb.org/t/p/original/b7Rwwc49fOayNJKIOSerNZGo1pq.jpg</thumb>
  <fanart url="">
    <thumb dim="" colors="" preview="http://image.tmdb.org/t/p/w1280/31SqCV9NfHvGJ8n7v60fV3oMobZ.jpg">http://image.tmdb.org/t/p/original/31SqCV9NfHvGJ8n7v60fV3oMobZ.jpg</thumb>
    <thumb dim="" colors="" preview="http://image.tmdb.org/t/p/w1280/hitJYC22IELrPPdHnSzTX4NK9Be.jpg">http://image.tmdb.org/t/p/original/hitJYC22IELrPPdHnSzTX4NK9Be.jpg</thumb>
    <thumb dim="" colors="" preview="http://image.tmdb.org/t/p/w1280/inpj4qYEs9LlljCy2tjw5aMkSFg.jpg">http://image.tmdb.org/t/p/original/inpj4qYEs9LlljCy2tjw5aMkSFg.jpg</thumb>
    <thumb dim="" colors="" preview="http://image.tmdb.org/t/p/w1280/u0lGvteH5bmAs2QO2EmLD3wQ5Bt.jpg">http://image.tmdb.org/t/p/original/u0lGvteH5bmAs2QO2EmLD3wQ5Bt.jpg</thumb>
  </fanart>
  <runtime>
  </runtime>
  <mpaa>Rated PG-13 for violence, intense sequences of action, and some strong language</mpaa>
  <genre>Action</genre>
  <genre>Crime</genre>
  <genre>Drama</genre>
  <genre>Thriller</genre>
  <credits>Richard Wenk</credits>
  <director>Richard Donner</director>
  <studio>Alcon Entertainment, Millennium Films, Emmett/Furla Films</studio>
  <trailer>http://r16---sn-vgqsen7y.googlevideo.com/videoplayback?expire=1394439980&amp;sver=3&amp;fexp=917000,935503,932103,945008,942701,916612,937417,913434,936910,936913,902907,934022&amp;id=e4539a053c507d11&amp;ms=au&amp;mt=1394415658&amp;itag=22&amp;ipbits=0&amp;ratebypass=yes&amp;source=youtube&amp;sparams=id,ip,ipbits,itag,ratebypass,source,upn,expire&amp;mv=m&amp;signature=952529B5F937A521AB9D30443DB45A9D674F99CD.2A505BDD41E475AE13B144C8D1A93E6A408D0746&amp;upn=VBRbSV9guS4&amp;ip=172.4.205.60&amp;key=yt5&amp;fallback_host=tc.v11.cache4.googlevideo.com&amp;signature=</trailer>
  <playcount>0</playcount>
  <lastplayed>
  </lastplayed>
  <id>tt0450232</id>
  <createdate>20140309214134</createdate>
  <stars>Bruce Willis, Mos Def, David Morse</stars>
  <actor>
    <name>Bruce Willis</name>
    <role>Det. Jack Mosley</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMjA0MjMzMTE5OF5BMl5BanBnXkFtZTcwMzQ2ODE3Mw@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Mos Def</name>
    <role>Eddie Bunker</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMjE4NTYzODcxN15BMl5BanBnXkFtZTcwNTg3MTEwNw@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>David Morse</name>
    <role>Det. Frank Nugent</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTgwNjUzOTE1N15BMl5BanBnXkFtZTYwNTU4NDQ0._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Jenna Stern</name>
    <role>Diane Mosley</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BNzQwNDgyMDI1MF5BMl5BanBnXkFtZTcwNjcyMzUxOA@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Casey Sander</name>
    <role>Capt. Dan Gruber</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTU1MDI2Mzg0MV5BMl5BanBnXkFtZTcwMjYyMjk1Mw@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Cylk Cozart</name>
    <role>Det. Jimmy Mulvey</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>David Zayas</name>
    <role>Det. Robert Torres</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMjA5NTkwMTg1N15BMl5BanBnXkFtZTcwNzU2ODE3Mw@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Robert Racki</name>
    <role>Det. Jerry Shue</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTMxMzQ2NjU1OF5BMl5BanBnXkFtZTcwMTYzMDgyMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Patrick Garrow</name>
    <role>Touhey</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMjA2NDI4ODExOF5BMl5BanBnXkFtZTcwMjUzOTgwNA@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Sasha Roiz</name>
    <role>Kaller</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMjA1NTE2MTE5Ml5BMl5BanBnXkFtZTcwOTQ2MDE1OA@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Conrad Pla</name>
    <role>Ortiz</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTk4NzkzNjcwMF5BMl5BanBnXkFtZTcwNDM3MjM0NQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Hechter Ubarry</name>
    <role>Maldonado</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Richard Fitzpatrick</name>
    <role>Deputy Commissioner Wagner</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BNDM1ODIxNDI4M15BMl5BanBnXkFtZTgwNTAxMTUyMTE@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Peter McRobbie</name>
    <role>Mike Sheehan</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTgyMTU1MzcwNV5BMl5BanBnXkFtZTcwOTIwMTUyOA@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Michael F. Keenan</name>
    <role>Ray Fitzpatrick</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Robert Clohessy</name>
    <role>Cannova</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTk3MTg1ODExMl5BMl5BanBnXkFtZTcwODY2NDIzMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Jess Mal Gibbons</name>
    <role>Pederson</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Tig Fong</name>
    <role>Briggs</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTYyOTI2NzM5Ml5BMl5BanBnXkFtZTcwNzAzNTYyMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Brenda Pressley</name>
    <role>ADA MacDonald</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTAxNzQ1OTg0NTJeQTJeQWpwZ15BbWU3MDM2OTY0Mzc@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Kim Chan</name>
    <role>Sam</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTgzMjY3NjI2Nl5BMl5BanBnXkFtZTcwNDU2MzUzMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Carmen López</name>
    <role>Gracie</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTc4NTkzNjUxOV5BMl5BanBnXkFtZTcwNzM2OTUyMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Scott McCord</name>
    <role>Lieutenant Kincaid</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTcyMDMxNzM3OV5BMl5BanBnXkFtZTcwMDY3MDMwOQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>David Sparrow</name>
    <role>Holding Cell Officer</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTIwODM0NTYwNV5BMl5BanBnXkFtZTcwOTk1MTAzMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Eduardo Gomez</name>
    <role>Holding Cell Prisoner</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Sam Kung</name>
    <role>Chinese Man</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Angela Seto</name>
    <role>Chinese Wife</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Bernie Henry</name>
    <role>Man with Caddy</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Nick Alachiotis</name>
    <role>Russian</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTU1NzcxNDkxOF5BMl5BanBnXkFtZTcwMTgzMjI5MQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Danny Lima</name>
    <role>Russian</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BNTYwNjUxMDkxM15BMl5BanBnXkFtZTcwNjA2NDgyMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Claudio Masciulli</name>
    <role>Dominic Forlini</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Efosa Otuomagie</name>
    <role>Bus Driver</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Christina Orjalo</name>
    <role>Little Girl on the Bus</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTQ2MTA3MTA3Ml5BMl5BanBnXkFtZTgwODkwNjEzMTE@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Richard Wenk</name>
    <role>ADA's Detective</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTM5MDE4NDc4M15BMl5BanBnXkFtZTYwMDk4NDQ0._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Derek Hoffman</name>
    <role>Carl - EMT</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Brian Read</name>
    <role>UPS Delivery Man</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Ryan Wulff</name>
    <role>DA'S Clerk</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Steve Kahan</name>
    <role>Restaurant Owner</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Paul Tuerpe</name>
    <role>Diane's Boyfriend</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Cece Neber Labao</name>
    <role>Restaurant Waitress</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Jim Chong</name>
    <role>Bus Passenger</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Betty Chong</name>
    <role>Bus Passenger</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Sam Moses</name>
    <role>Bus Passenger</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Kathy Imrie</name>
    <role>Bus Passenger</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Jason Burke</name>
    <role>Bus Passenger</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Tom Wlaschiha</name>
    <role>Bus Passenger</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMjMyMjg4NzgzN15BMl5BanBnXkFtZTgwMzEzMzUwMTE@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Scott Douglas</name>
    <role>Bus Passenger</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>J.D. Nicholsen</name>
    <role>Man in Gray Suit</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Kameron Louangxay</name>
    <role>Communications Tech</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BNDQ0MTY2MDEzMF5BMl5BanBnXkFtZTcwNTYwNjQzMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Victoria Mitchell</name>
    <role>Woman in Apartment</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Cecil Phillips</name>
    <role>MTA Cop</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Rob Wiethoff</name>
    <role>Court Officer</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Jimmy Campbell</name>
    <role>Court Officer</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Richard Collier</name>
    <role>Court Officer</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Aaron Ferguson</name>
    <role>Court Officer</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Bradley Paterson</name>
    <role>Brad - EMT</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Paul J.Q. Lee</name>
    <role>Asian Store Owner</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTE5MjM3ODk0Nl5BMl5BanBnXkFtZTYwNjgyMjcy._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Heather Dawn</name>
    <role>The Juror</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTg0NTkwMzc5M15BMl5BanBnXkFtZTYwMTE3MDgy._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Daryl Dismond</name>
    <role>Man in Suit</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Jim Lavin</name>
    <role>Car Key Detective</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTI4ODY2NzA3OF5BMl5BanBnXkFtZTYwMzcxNzgy._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Beatriz Yuste</name>
    <role>Subway Commuter</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTg1MzAwODExN15BMl5BanBnXkFtZTcwNTMyMjY2Ng@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>David Talbolt</name>
    <role>Subway Commuter</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Toni Ellwand</name>
    <role>Subway Commuter</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Rolando Alvarez Giacoman</name>
    <role>Subway Commuter</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Brian G. Andersson</name>
    <role>Detective</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Robert Bizik</name>
    <role>Construction Worker</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMjMwNTc0NjI2OV5BMl5BanBnXkFtZTcwNjQ0NTMxNw@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Ed Cuffe</name>
    <role>Pedestrian</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTQxOTgwNTU2MV5BMl5BanBnXkFtZTcwNzQ3MTg1MQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Joseph DeBona</name>
    <role>Detective</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Richard Donner</name>
    <role>Man Holding a Birthday Cake</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTQ0NzA2NjQzNl5BMl5BanBnXkFtZTYwNzg4NDQ0._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Albert Duic</name>
    <role>Paramedic</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTc1NDI1OTM5M15BMl5BanBnXkFtZTgwNTc2MTY4MDE@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Marshall Factora</name>
    <role>Juror</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTkwMzMxMjYyOV5BMl5BanBnXkFtZTcwNjQ0NTI2NA@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Victor Formosa</name>
    <role>Businessman</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Eli Harris</name>
    <role>Cab Driver</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTQ0NDQyMTcyM15BMl5BanBnXkFtZTcwNTY0NTA4OA@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Alan Lee</name>
    <role>Subway Commuter</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Kevin P. McCarthy</name>
    <role>Person in Cab</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTkyNzQzNzExM15BMl5BanBnXkFtZTcwNjA4NjkzMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Liam McGuckian</name>
    <role>Nephew</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTI3MjcwMDQ0OF5BMl5BanBnXkFtZTYwMzMzNjYy._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Denis McKeown</name>
    <role>Pedestrian</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMjAzOTM3NTY5M15BMl5BanBnXkFtZTcwNDg0NTMzMg@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Allison Lee Ritter</name>
    <role>Passenger</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Khalid Rivera</name>
    <role>Pedestrian</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Joe Rosario</name>
    <role>Juror #4</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTc4NTI4ODAxNl5BMl5BanBnXkFtZTgwNzA5Nzg0MDE@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Talia Russo</name>
    <role>Young Bride</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTQ5NTQ3MDEzNl5BMl5BanBnXkFtZTcwOTU2MzEzMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Norman Schleiffer</name>
    <role>Man in Park Feeding Pidgeons</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTQyODAyNDAxM15BMl5BanBnXkFyZXN1bWU@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Alex Scrymgeour</name>
    <role>Cop</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTkwMzIyMjQzOV5BMl5BanBnXkFtZTgwODA2MzQxMTE@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Michael Segovia</name>
    <role>Russian Boy</role>
    <thumb>
    </thumb>
  </actor>
  <actor>
    <name>Joseph Siravo</name>
    <role>District Attorney Haynes</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTc2NDAyODA5M15BMl5BanBnXkFtZTcwMDY3OTE2OA@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Brian Smyj</name>
    <role>Sniper</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BODMwNjYyMzQwNV5BMl5BanBnXkFtZTcwNTEzNDY1Mw@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Jeremy J. Sullivan</name>
    <role>Court Officer</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTU5ODI4ODM1NV5BMl5BanBnXkFtZTcwMzQxMTAzMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Svetlana Titova</name>
    <role>Waitress</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTc5Mzc1NTU1M15BMl5BanBnXkFtZTcwNjk0MTI2MQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Joshua Tolby</name>
    <role>Pedestrian</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTY4ODQ0ODE4MF5BMl5BanBnXkFtZTcwMTUwMzIzMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Schuster Vance</name>
    <role>Detective</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BOTAxOTc3NDUxNF5BMl5BanBnXkFtZTcwMTA4NjcyMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Sonny Vellozzi</name>
    <role>Pedestrian</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTU0NzIyODM4N15BMl5BanBnXkFtZTcwMDM1MTQ3Mg@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>Emerson Wong</name>
    <role>Alleyway Chinese Cook</role>
    <thumb>http://ia.media-imdb.com/images/M/MV5BMTM1MzE0OTY5OF5BMl5BanBnXkFtZTcwNjQ2MTkzMQ@@._V1._SY400_SX300_.jpg</thumb>
  </actor>
  <actor>
    <name>William S. Wong</name>
    <role>Delivery Man</role>
    <thumb>
    </thumb>
  </actor>
</movie>

Share this post


Link to post
Share on other sites
BrewManNH

You might want to look at the XMLDom wrapper UDF in the example scripts section.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
FireFox

I suggest you to get the title and the id instead of replacing the rest.

#include <Array.au3>

$s = FileRead("t.txt") ;file containing the data

$a = StringRegExp($s, "<(?:title|id)>(.*?)</(?:title|id)>", 3)

_ArrayDisplay($a)

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
jdelaney

XMLDOM route:

$sLocalXMLFile = @DesktopDir & "\xml.xml"
$oXML = ObjCreate("Microsoft.XMLDOM")
$oXML.load($sLocalXMLFile)

$oTitle = $oXML.selectSingleNode("//title")
$oID = $oXML.selectSingleNode("//id")

ConsoleWrite($oTitle.text & @CRLF)
ConsoleWrite($oID.text & @CRLF)

Note, that your XML is not valid as is, change the first line to this:

<?xml version="1.0" encoding="ASCII" standalone="yes"?>


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

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  

×