home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
My Films
Grabber scripts for MyFilms & AMCupdater (and Beta Tool)
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Guzzi" data-source="post: 697666" data-attributes="member: 55213"><p><strong>AW: Re: Grabber scripts for MyFilms & AMCupdater (and Beta Tool)</strong></p><p></p><p></p><p></p><p>Looking in the code it works as follows:</p><p></p><p>You can put "#REGEX#" in the "KeyStart" and/or "KeyStop" Windows as first expression, followed by the expression to do search on start / stop point with that expression, instead of standard search "lastindexof".</p><p></p><p>You can put "#REVERSE#" on "Replace" window as first expression -> resulting in finding the first instead of last item</p><p></p><p>If you put "#REGEX#" in "Replace" following a regular expression, all findings will be replaced by value in "With" window.</p><p></p><p>To your question:</p><p>If there is an expression in "RegExp" AND "Replace" starts with "#REGEX#", this results in replacing all matches found with RegExp with replacement value "With".</p><p></p><p>Might be easier to look at the codepart to understand (param1 = "Replace", param2 = "With", param3 = RegExp):</p><p></p><p>[CODE]</p><p> if (param3.Length > 0)</p><p> {</p><p> Regex oRegex = new Regex(param3);</p><p> Regex oRegexReplace = new Regex(string.Empty);</p><p> System.Text.RegularExpressions.MatchCollection oMatches = oRegex.Matches(strTemp);</p><p> foreach (System.Text.RegularExpressions.Match oMatch in oMatches)</p><p> {</p><p> if (param1.StartsWith("#REGEX#"))</p><p> {</p><p> oRegexReplace = new Regex(param1.Substring(7));</p><p> strTemp = strTemp.Replace(oMatch.Value, oRegexReplace.Replace(oMatch.Value, param2));</p><p> }</p><p></p><p>[/CODE]</p><p></p><p></p><p>hope this helps ....</p></blockquote><p></p>
[QUOTE="Guzzi, post: 697666, member: 55213"] [b]AW: Re: Grabber scripts for MyFilms & AMCupdater (and Beta Tool)[/b] Looking in the code it works as follows: You can put "#REGEX#" in the "KeyStart" and/or "KeyStop" Windows as first expression, followed by the expression to do search on start / stop point with that expression, instead of standard search "lastindexof". You can put "#REVERSE#" on "Replace" window as first expression -> resulting in finding the first instead of last item If you put "#REGEX#" in "Replace" following a regular expression, all findings will be replaced by value in "With" window. To your question: If there is an expression in "RegExp" AND "Replace" starts with "#REGEX#", this results in replacing all matches found with RegExp with replacement value "With". Might be easier to look at the codepart to understand (param1 = "Replace", param2 = "With", param3 = RegExp): [CODE] if (param3.Length > 0) { Regex oRegex = new Regex(param3); Regex oRegexReplace = new Regex(string.Empty); System.Text.RegularExpressions.MatchCollection oMatches = oRegex.Matches(strTemp); foreach (System.Text.RegularExpressions.Match oMatch in oMatches) { if (param1.StartsWith("#REGEX#")) { oRegexReplace = new Regex(param1.Substring(7)); strTemp = strTemp.Replace(oMatch.Value, oRegexReplace.Replace(oMatch.Value, param2)); } [/CODE] hope this helps .... [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
My Films
Grabber scripts for MyFilms & AMCupdater (and Beta Tool)
Contact us
RSS
Top
Bottom