小编Sar*_*ikh的帖子

在小吃店 Angular 4 中添加换行符

我想添加带有由我提供的正确换行符的多行文本消息。

  this.sampleStringErrorMsg = 'The sample is not valid:\n' +
            '- The key and key value are required in the sample.\n ' +
            '- The delimiter must be entered when the sample contains several key-value pairs.\n' +
            '- The delimiter must not be equal to the key or key value.\n';
Run Code Online (Sandbox Code Playgroud)

sampleStringErrorMsg 是我在零食栏中显示的文本。现在零食栏\n从文本中省略并对齐整个消息,如下图所示 在此处输入图片说明

snackbar angular

11
推荐指数
2
解决办法
9838
查看次数

不允许以2*开头的正则表达式

我想知道正则表达式不允许使用字符串

**Test
Run Code Online (Sandbox Code Playgroud)

但字符串就像

*test, test,123, 
Run Code Online (Sandbox Code Playgroud)

被允许.所以基本上从2开始Asterix(*)不允许休息一切都是允许的.

我试过跟随正则表达式

[^(\*{2})].* [^(\*\*)].* [^(\*\*)$].* ^(?!\*\*.*)

regex regex-negation typescript

5
推荐指数
1
解决办法
51
查看次数

标签 统计

angular ×1

regex ×1

regex-negation ×1

snackbar ×1

typescript ×1