Remove Pattern method, regular expression problem

Advanced Renamer forum
#1 : 03/08-18 16:43
James S Witherspoon
James S Witherspoon
Posts: 5
I am trying the built-in methods to change the name of an .html file to text between the <title> and </title> tags.

Here's my method list from the AREN file -

method0000=methodname:"newname"; active:"1"; mask:"<filecontent:0:500>"; tagpage:"0"; applyto:"name";
method0001=methodname:"removepattern"; active:"1"; pattern:".*<title>"; casesensitive:"0"; regularexpressions:"1"; applyto:"name";
method0002=methodname:"removepattern"; active:"1"; pattern:"</title>.*"; casesensitive:"0"; regularexpressions:"1"; applyto:"name";

The first two methods work ok - the new file name now begins with the all the text of the html file beginning with the first character after the <title> tag.

The third method doesn't work. Using the remove pattern "</title>.*" (using regular expression) matches only the characters </title> and the .* doesn't remove the remainder of the file name.

I've succeeded in making a script that does the job but I am wondering why the built-in method didn't work as I intended. Is the * multiplier being applied to the entire pattern "<title>." instead of just the . wildcard?


03/08-18 16:43
#2 : 04/08-18 05:00
James S Witherspoon
James S Witherspoon
Posts: 5
Reply to #1:
I should clarify that after removing the first <title> tag from the filename, following the actual title (which I wanted to keep for my file name) were more HTML tags enclosed in angle brackets. I suspect that part of the problem is that AR tags are enclosed in angle brackets, so this is how AR wants to treat them.

I did succeed in removing everything but a concluding space, using the following "Remove Pattern" - (\<.*\>).* - so that all instances of a literal < or >, and any enclosed content, would be removed.


04/08-18 05:00