d0n Posted January 17, 2010 Share Posted January 17, 2010 I am trying to get some data from a string $Info = StringRegExp($Source, 'target="_blank">?\s?(?:<strong>|title="">)?(.*?)\s(?i:Ch?H?\s*?(\d+)|(\d+)).torrent', 1) There are 2 different types of names target="_blank" title="">TVSHOWNAME 2010-01-16.torrent target="_blank" title="">TVSHOWNAME CH01.torrent I want to get 1. TVSHOWNAME (this part is working) 2. either 20100116 or 01 (01 works but not sure how to get the 20100116 to work) Link to comment Share on other sites More sharing options...
Malkey Posted January 18, 2010 Share Posted January 18, 2010 (edited) This might help. #include <Array.au3> Local $Source = 'target="_blank" title="">TVSHOWNAME 2010-01-16.torrent' & @CRLF & _ 'target="_blank" title="">TVSHOWNAME CH01.torrent' Local $Info = StringTrimRight(StringRegExpReplace($Source, _ 'target=.*?="">(.*?)\s(?:[^\d]*)([\d]+)(?:[^\d]?)([\d]{0,2})(?:[^\d]?)([\d]{0,2})\.torrent', _ "\1 \2\3\4 "), 2) ; 2 spaces after \1 and 2 spaces after \4 ConsoleWrite($Info & @CRLF) Local $aInfo = StringSplit($Info, " ", 3) ; 2 spaces within " " _ArrayDisplay($aInfo) Edit: It appears the 2 spaces auto-change into 1 space. So please check that the 3 places that require 2 spaces do have 2 spaces and not 1 space. Edited January 18, 2010 by Malkey Link to comment Share on other sites More sharing options...
d0n Posted January 18, 2010 Author Share Posted January 18, 2010 thanks for the help, never thought of using stringregexpreplace 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