世界上最难的“常规表达式”怎么写

oicqkill 2002-06-15 08:27:22
如果在一个文件里有下面的数据结构多个,请问我要把下面的东西用常规表达式(正则表达式) 匹配出来并放入数组里,该怎么写这个-----常规表达式(正则表达式) 呢?

struct ipx_opt {
ipx_address dest_addr;
ipx_interface *intrfc;
unsigned short port;
#ifdef CONFIG_IPX_INTERN
unsigned char node[IPX_NODE_LEN];
#endif
unsigned short type;
/*
struct unix_opt {
struct unix_address *addr;
struct dentry * dentry;
struct vfsmount * mnt;
struct semaphore readsem;
struct sock * other;
struct sock ** list;
struct sock * gc_tree;
atomic_t inflight;
rwlock_t lock;
wait_queue_head_t peer_wait;
};
* To handle special ncp connection-handling sockets for mars_nwe,
* the connection number must be stored in the socket.
*/
struct ipv6_pinfo {
struct in6_addr saddr;
struct in6_addr rcv_saddr;
struct in6_addr daddr;
struct in6_addr *daddr_cache;

__u32 flow_label;
__u32 frag_size;
int hop_limit;
int mcast_hops;
int mcast_oif;

/* pktoption flags */
union {
struct {
__u8 srcrt:2,
rxinfo:1,
rxhlim:1,
hopopts:1,
dstopts:1,
authhdr:1,
rxflow:1;
} bits;
__u8 all;
} rxopt;
unsigned short ipx_ncp_conn;
};
...全文
35 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
leelix 2002-06-23
  • 打赏
  • 举报
回复
i don't think it's a good way to match the data with that data structure, cuz perl can also read in binary data structure and put them into variable through 'unpack' keyword.

see 'perlfunc' in Acitver Perl Help for 'unpack' help
jinandsun 2002-06-16
  • 打赏
  • 举报
回复
还不错啊
不过找不到破戒版的啊!
oicqkill 2002-06-15
  • 打赏
  • 举报
回复
假如注释里用:
//wgjljglejgklegjlejldjgldjgld
呢?又该怎么处理,
请给我来邮件 xiat@guanfang.com.cn

即可给朋友---您 加分,如果蒙不弃 做个朋友,OK!?

2,204

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 CGI
社区管理员
  • CGI社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧