Reputation: 2789
How to extract html tags from a file using javascript regex.
I try with this regex /<.*>.*<\/.*>/s
but it not give the expected result.
here is my source file
import { Component, Input, OnInit, ViewEncapsulation, Output,
EventEmitter } from '@angular/core';
@Component({
selector: 'mgmt-ui-input',
templateUrl: './ui-input.component.html',
styleUrls: ['./ui-input.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class UiInputComponent implements OnInit {
/**
* @example
* <mgmt-ui-input
* [showIconX]="true"
* [showIconV]="true"
* (close)="onClose($event)"
* >
* <input type="text">
* </mgmt-ui-input>
*
*
*
* show icon x
* @type {boolean}
*/
@Input() showIconX = true;
@Input() showIconV = true;
@Output() close = new EventEmitter<void>();
constructor() {
}
ngOnInit() {
}
}
here is the expected result from the regex
<mgmt-ui-input
[showIconX]="true"
[showIconV]="true"
(close)="onClose($event)"
>
<input type="text">
</mgmt-ui-input>
Upvotes: 0
Views: 135