Created
June 28, 2012 03:44
-
-
Save dnnta/3008842 to your computer and use it in GitHub Desktop.
web regex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Config.h | |
// ZanSe | |
// | |
// Created by dnnta on 12-12-13. | |
// Copyright (c) 2012年 NightWish. All rights reserved. | |
// | |
// | |
// Config.h | |
// Zhihu | |
// | |
// Created by Kevin Nick on 2012-10-28. | |
// Copyright (c) 2012年 com.zen. All rights reserved. | |
// | |
#ifndef SysLog | |
#if DEBUG | |
#define SysLog(fmt, ...) NSLog((@"%s [Line: %d] \n " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#else | |
#define SysLog(fmt, ...) | |
#define NSLog(fmt, ...) | |
#endif | |
#endif | |
#define RGB(r, g, b) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1] | |
#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a] | |
#define DarkColor [UIColor darkGrayColor] | |
// Helvetica Hiragino | |
// Post Content Font | |
#define PCFont [UIFont fontWithName:@"Helvetica" size:15] | |
// Post Author Font | |
#define PAFont [UIFont fontWithName:@"Helvetica" size:13] | |
// ****************************************** | |
// String Define | |
#define ZANSE_BASE_URL @"http://bbs.jjwxc.net" | |
#define POST_REGEX \ | |
@"href=\"showmsg.php\\?board=(\\d+)&id=(\\d+)&msg=.*\" target=\"_blank\" title=\"最后更新:(.*?)\">(.*?) [\\s\\S]*?<td> (.*?)</td>[\\s\\S]*?size=\"-1\">(.*?)</font>[\\s\\S]*?size=-1>(\\d+) </font>[\\s\\S]*?size=-1>(\\d+) " | |
#define POST_INFO \ | |
@"主题:(.*?)\\s<font color=\"#999999\" size=\"-1\">\\[(\\d+),(\\d+)\\]" | |
#define DETAIL_REGEX \ | |
@"<td class=\"read\">([\\s\\S]*?)</td>[\\s\\S]*?№(\\d+).*?</font>.*?</font>(.*?)</b>.*?</font>(.*?)留言" | |
#define Post_Path(board, page) \ | |
[NSString stringWithFormat:@"board.php?board=%d&page=%d", board, page]; | |
#define Comment_Path(board, pid, page) \ | |
[NSString stringWithFormat:@"showmsg.php?board=%@&id=%@&page=%d", board, pid, page] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment