-topic moved-

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Yaosr
Posts: 53
Joined: 04 Nov 2017, 04:59

-topic moved-

17 May 2018, 12:48

-topic moved-
Last edited by Yaosr on 13 Jun 2018, 08:12, edited 1 time in total.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: remove a special sign

17 May 2018, 13:28

<.*?>|#\w*?\b

Untested
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: remove a special sign

17 May 2018, 13:37

I suggest using a htmlfile object to parse and edit html. For instance:

Code: Select all

html =
(
<html>

<title>some title</title>

<head></head>

<body>
	<div>
		<p>this is some paragraph</p>
	</div>
	<p>this is some other paragraph</p>
	<div>some random div</div>
</body>

</html>
)

msgbox % RemoveTags( "p", html )

Return

RemoveTags( tagName, html )
{
	htmObj 		:= ComObjCreate( "htmlfile" ), htmObj.write( html )
	tagRef 		:= htmObj.getElementsByTagName( tagName )

	While ( tagRef.length >= a_index-1  )
		tagRef[ 0 ].parentNode.removeChild( tagRef[ 0 ] )

	return htmObj.getElementsByTagName( "*" )[ 0 ].innerHTML
}
Using the object is more reliable than trying to replace/remove tags by string.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], gongnl, Rohwedder and 283 guests