我想添加带有由我提供的正确换行符的多行文本消息。
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从文本中省略并对齐整个消息,如下图所示

我想知道正则表达式不允许使用字符串
**Test
Run Code Online (Sandbox Code Playgroud)
但字符串就像
*test, test,123,
Run Code Online (Sandbox Code Playgroud)
被允许.所以基本上从2开始Asterix(*)不允许休息一切都是允许的.
我试过跟随正则表达式
[^(\*{2})].*
[^(\*\*)].*
[^(\*\*)$].*
^(?!\*\*.*)