• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

verypig

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

2012年2月28日

17种正则表达式

摘要: "^\\d+$" //非负整数(正整数 + 0) "^[0-9]*[1-9][0-9]*$" //正整数 "^((-\\d+)|(0+))$" //非正整数(负整数 + 0) "^-[0-9]*[1-9][0-9]*$" //负整数 "^-?\\d+$" //整数 "^\\d+(\\.\\d+)?$" //非负浮点数(正浮点数 + 0) "^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0- 阅读全文

posted @ 2012-02-28 11:24 verypig 阅读(104) 评论(0) 推荐(0)

oos.org

摘要: http://oss.org.cn/man/unix/susv3/basedefs/regex.h.html 阅读全文

posted @ 2012-02-28 10:02 verypig 阅读(113) 评论(0) 推荐(0)

regex

摘要: 在GNU C 中要使用规则表达式,需要用到以下几个函数。(定义在/usr/include/regex.h文件中) * int regcomp (regex_t *compiled, const char *pattern, int cflags) * int regexec (regex_t *compiled, char *string, size_t nmatch, regmatch_t matchptr [], int eflags) * void regfree (regex_t *compiled) * size_t regerror (int errc... 阅读全文

posted @ 2012-02-28 09:50 verypig 阅读(287) 评论(0) 推荐(0)

 
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3