我使用 EditPad Pro 文本编辑器。我需要将字符串读入代码,但我需要忽略以标签“/*”或制表符 + /* 开头的字符串,例如:
/**
* Light up the dungeon using "claravoyance"
*
* memorizes all floor grids too.
**/
/** This function returns TRUE if a "line of sight" **/
#include "cave.h"
(tab here) /* Vertical "knights" */
if (g->multiple_objects) {
/* Get the "pile" feature instead */
k_ptr = &k_info[0];
}
put_str("Text inside", hgt - 1, (wid - COL_MAP) / 2);
/* More code*** */
我喜欢返回:
"Text inside"
我已经尝试过这个(读取不以序列开头的字符串的正则表达式),但对我不起作用:
^(?! \*/\t).+".*"
有什么帮助吗?
编辑:我用过:
^(?!#| |(\t*/)|(/)).+".*"
它返回:
put_str("Text inside"
我快要找到解决方案了。