当前我有75,000行文本,但是我试图弄清楚如何仅从冒号复制文本。文本文件如下所示。我只想获得QQQQ:EEEE和UUUU:IIII
QQQQ:EEEE
-------------------------------------------
Apples
Organges
Banana
Grapes
--------------------------------------------
UUUU:IIII
---------------------------------------------
Carrots
Beets
Watermelon
Melon
----------------------------------------------
答案 0 :(得分:0)
正则表达式angular.module('app').directive('myDirective', function () {
return {
restrict: 'AE',
transclude: 'element',
replace:true,
scope: true,
controller: function ($scope) {
$scope.formId = 'Form1';
$scope.submit = submit;
function submit() {
console.log('submited...');
}
},
link: function (scope, elem, attributes) {
var element = elem[0];
//add form attribute to element
angular.element(element).attr('ng-form', scope.formId);
//change child element
var btn1 = $compile(angular.element('<md-button class="md-primary md-hue-1">Button 1</md-button>'))(scope);
angular.element(element.querySelector("btn1-placeholder")).replaceWith(btn1);
//submit btn
var submitBtn = angular.element(element.querySelector("[submit-btn]"))
.attr('ng-disabled', scope.formId + '.form.$invalid')
.attr('type', 'submit');
//compile in order for btn to work
submitBtn.replaceWith($compile(submitBtn)(scope));
},
template: '<ng-transclude></ng-transclude>'
}
});
应该在记事本++中工作