Using $regsubex to strip 'tags' - 12/12/07 09:58 PM
The following code posted elsewhere on this site strips out html tags
I have modified it as follows,
having renamed it and replaced '<' & '>' with '{' & '}'.
The new alias performs a similar function to that of $hst, but strips out 'tags' delimited by curly brackets instead of tags delimited by angle brackets. However, the alias fails to perform as I would wish when there is a space between the opening '{' and the contents of the 'tag'. Any advice would be appreciated.
Code:
alias hst { return $regsubex($1,/<.+?>/g,) }
I have modified it as follows,
Code:
alias braces { return $regsubex($1,/{.+?>}g,) }
having renamed it and replaced '<' & '>' with '{' & '}'.
The new alias performs a similar function to that of $hst, but strips out 'tags' delimited by curly brackets instead of tags delimited by angle brackets. However, the alias fails to perform as I would wish when there is a space between the opening '{' and the contents of the 'tag'. Any advice would be appreciated.