Skip to content

Commit a41120f

Browse files
committed
Enhance regex filtering in TrimmingTextArea
1 parent c74f621 commit a41120f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

SequenceAnalysis/resources/web/SequenceAnalysis/field/TrimmingTextArea.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ Ext4.define('SequenceAnalysis.field.TrimmingTextArea', {
1515
}
1616
});
1717

18+
if (this.stripCharsRe && Ext4.isString(this.stripCharsRe)) {
19+
this.stripCharsRe = this.stripCharsRe.replaceAll('^/', '')
20+
this.stripCharsRe = this.stripCharsRe.split(/(?=\/)\//)
21+
if (this.stripCharsRe.length && this.stripCharsRe[0] === '') {
22+
this.stripCharsRe.shift()
23+
}
24+
this.stripCharsRe = new RegExp(this.stripCharsRe[0], this.stripCharsRe.length > 1 ? this.stripCharsRe[1] : null)
25+
}
1826

1927
this.callParent();
2028
},
@@ -53,6 +61,11 @@ Ext4.define('SequenceAnalysis.field.TrimmingTextArea', {
5361
if (val){
5462
val = Ext4.String.trim(val);
5563
val = val.replace(/(\r\n|\n|\r)/gm,this.delimiter);
64+
65+
if (val && this.stripCharsRe) {
66+
val = val.replace(this.stripCharsRe, '');
67+
}
68+
5669
if (this.replaceAllWhitespace) {
5770
val = val.replace(/ /g, '');
5871
}

0 commit comments

Comments
 (0)