English 中文(简体)
摘取从温带产出中的独特传名(通过reg?)
原标题:Extracting unique syscall names from strace output (via regex?)

我有strace,其中载有所有系统电话。 现在我想获得所有系统的名称。 因此,我要说,如果我有<代码>mprotect,则我只需要一分钟,我只需要列出独特的系统电话。

一种思维方式是使用假装或支持定期表达的其他语言定期表达,首先看所有系统电话,然后消除重复。 为此,我首先尝试利用附注pad++的搜索特征测试我的定期表述。 我想与这一条相匹配。 为此,我制定了以下定期表述:

但笔记没有发现。 你认为,这样做是正确的定期表述?

最佳回答

你们为什么认为需要定期表达这一点? <代码>strace的输出是一系列的线体,从每一条开始。

<c_identifier>(

识别符号可以有<代码>(),因此,你只能参加<代码>()以获得系统名称。 在Adhur,这个一线人对一套不同的系统进行 comp击:

syscalls = set(ln.split( ( , 1)[0] for ln in strace_output)

(如果你在伤口工作而不是在Awk的一线工作,你也可以这样做)。

问题回答

Notepad++本应告诉你invalid regular expression。 最新版本就是这样。

定期表示,母体具有特别的意义,因此,你必须逃离:

[a-zA-Z_](

<h>( in blah (),因为方括号中的部分为t定量(如@CharlesDuffy所指出)。

为了与整个<代码>blah()保持一致,使用

[a-zA-Z_]+(

It should be [a-zA-Z_]+( instead. This is because round brackets are used as meta characters.





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...

热门标签