Q: batch rename html files according to words between the same html tag


I have many html files in Windows 10. Each html file contains this tag in the source for one time:

(html tag) some word (\html tag)

This tag is the same and unique in each html file but the words between the tag is different.

Is there any way to do that?


Thanks so much

Something to play with:

Thank u for trying helping me

I have tried but it didn’t work.


I have many html files.

The html tag is like this:

(p class="something")some(span class="x")titel(/span)(/p_)

I want to rename the files according to some titel with ignoring another html tags between (p class=“something”) and (/p) and ignoring |/?*":><

Any Help?

This is a simple string replace, and can be done using regex replace.


# Remove all parens and the strings between those parens.
'(p class="something")some(span class="x")titel(/span)(/p_)' -replace '\((.*?)\)',''

# Results


Just loop thru you files and pass the above results in your Rename-Item effort.