我正在使用以下正则表达式操作来查找文本的某些部分-
\/\*\*((\n \*.*)*)\/\n((.*\n))*?\{
然后用以下模式替换它
\/\*\*$1\/\n$3\{\nprintk("**$1");\n
我是使用正则表达式的新手,我想删除 $1 中包含的换行符,这可能吗?如果可以,怎么办?
- - 编辑 - -
例子:
/**
* This is a multiline commment1
* This is a multiline commment2
* This is a multiline commment3
**/
int fnName(struct a *b)
{
return 0;
}
电流输出为
/**
* This is a multiline commment1
* This is a multiline commment2
* This is a multiline commment3
**/
int fnName(struct a *b)
{
printk("**
* This is a multiline commment1
* This is a multiline commment2
* This is a multiline commment3
**");
return 0;
}
虽然我想要输出为
/**
* This is a multiline commment1
* This is a multiline commment2
* This is a multiline commment3
**/
int fnName(struct a *b)
{
printk("** * This is a multiline commment1 * This is a multiline commment2 * This is a multiline commment3 **");
return 0;
}