`
mlzboy
  • 浏览: 703373 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

RegexBuddy使用例子,及Visual Studio中正则使用的请教

阅读更多

我有一段代码,如下,以前写的,不命名不规范,都以小写的get打头,我想把它改成以Get打头,于是想到了正则

 

<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Utils
{
    
class DateTimeHelper
    {
        public static string getYear()
        {
            
return DateTime.Now.Year.ToString();
        }
        public string getMonth()
        {
            
return Microsoft.VisualBasic.Strings.Right("00" + DateTime.Now.Month.ToString(), 2);
        }
        public string getDay()
        {
            
return Microsoft.VisualBasic.Strings.Right("00" + DateTime.Now.Day.ToString(), 2);
        }
        public string getYYYYMMDD()
        {
            
return this.getYear() + this.getMonth() + this.getDay();
        }
        public string getHour()
        {
            
return vb.Right("00" + DateTime.Now.Hour.ToString(), 2);
        }
        public string getMinute()
        {
            
return vb.Right("00" + DateTime.Now.Minute.ToString(), 2);
        }
        public string getSecond()
        {
            
return vb.Right("00" + DateTime.Now.Second.ToString(), 2);
        }
        public string getMillsecond()
        {
            
return DateTime.Now.Millisecond.ToString();
        }
        public string getHHMMSS()
        {
            
return this.getHour() + this.getMinute() + this.getSecond();
        }
    }
}

我在RegexBuddy下使用

 这里修改后的,对你或许还有点用

 

<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using vb 
= Microsoft.VisualBasic.Strings;
namespace Utils
{
    
class DateTimeHelper
    {
        public static string GetYear()
        {
            
return DateTime.Now.Year.ToString();
        }
        public static string GetMonth()
        {
            
return Microsoft.VisualBasic.Strings.Right("00" + DateTime.Now.Month.ToString(), 2);
        }
        public static string GetDay()
        {
            
return Microsoft.VisualBasic.Strings.Right("00" + DateTime.Now.Day.ToString(), 2);
        }
        public static string GetYYYYMMDD()
        {
            
return GetYear() + GetMonth() + GetDay();
        }
        public static string GetHour()
        {
            
return vb.Right("00" + DateTime.Now.Hour.ToString(), 2);
        }
        public static string GetMinute()
        {
            
return vb.Right("00" + DateTime.Now.Minute.ToString(), 2);
        }
        public static string GetSecond()
        {
            
return vb.Right("00" + DateTime.Now.Second.ToString(), 2);
        }
        public static string GetMillsecond()
        {
            
return DateTime.Now.Millisecond.ToString();
        }
        public static string GetHHMMSS()
        {
            
return GetHour() + GetMinute() + GetSecond();
        }
    }
}

 烦请高手解答一下我的疑惑,在vistual studio 或是editplus中怎么实现这个正则的替换啊

 

分享到:
评论

相关推荐

    RegexBuddy工具使用教程

    RegexBuddy 是学习正则表达式时的比较好的帮手,本文档通过图文的讲解形式,使用户能够快速了解该工具的功能及使用方式。

    RegexBuddy

    RegexBuddy 正则

    RegexBuddy 4.11.zip

    RegexBuddy是您使用正则表达式的完美伴侣。轻松创建与所需内容完全匹配的正则表达式。清楚了解他人编写的复杂正则表达式。快速测试样本字符串和文件上的任何正则表达式,防止实际数据出错。通过逐步完成实际的匹配...

    regexbuddy4.zip

    regexbuddy中文破解版是一款在全球非常知名的正则式测试工具,对于从事编程行业用户来说,正则式是我们经常使用到的一项功能,而在用户编写好正则式后,如果想要知道所编写的正则式是否符合规范,那么这时我们就需要...

    RegexBuddy 4.13

    RegexBuddy 4.13 正则表达式专业工具,简单方便好用。

    RegexBuddy v3.1.1 Retail(零售注册版)

    本人实测 详细版本信息:RegexBuddy Version 3.1.1 发布日期:3 April 2008 RegexBuddy是一款正则表达式工具。 它是你使用正则表达式时的最好的...可以把RegexBuddy整合到你喜好的搜索和编辑工具里,以便快速使用。

    RegexBuddy-v3.1.0

    RegexBuddy是学习、使用正则表达式的必备工具,其包含PCRE、Java、.Net、Perl、Ruby、Tcl、Javascript等主流正则表达式引擎,提供了正则表达式分析、测试、调试功能,并包含大量实用例子和不同语言、引擎下的代码...

    正则表达式工具RegexBuddy

    RegexBuddy破解软件,无需注册。 压缩包中有两个程序,RegexBuddy4.0是需要安装的,RegexBuddy3.0是绿色软件

    RegexBuddy免注册零售版

    RegexBuddy免注册零售版是一款正则表达式编辑工具,帮助你的编写需要的正则表达式,还可以使用它理解别人编写的表达式。RegexBuddy提供可视化的支持、提示、调试方面的便利;在使用正则表达式时,RegexBuddy将正则式...

    regexbuddy英文CHM文档

    regexbuddy英文CHM文档,学习使用正则表达式的朋友请下载

    RegexBuddy 4.9 特别版

    最新的RegexBuddy 4.9版.测试过,使用正常,安装后用破解补丁覆盖即可,如果不缺钱,建议支持正版.

    真正RegexBuddy破解版

    RegexBuddy is your perfect companion for working with regular expressions. Easily create regular expressions that match exactly what you want. Clearly understand complex regexes written by others. ...

    RegexBuddy3.6.0最新注册版

    RegexBuddy 3.6.0 – 25 October 2012 最新注册版 Improvements: Test: Open URL window should allow right-click Paste. Windows 8: Uninstall shortcut is no longer pinned to the start screen by the ...

    正则表达式工具regexbuddy

    根据正则表达式语法,彩色显示表达式,使表达式便于阅读。 同步将正则表达式的组成显示在 "树结构" 和 "分组列表" 中,使正则表达式结构一目了然。 详细记录每一个匹配结果,包含分组结果以及所花费的时间。...

    RegexBuddy.4.5.0.Retail

    RegexBuddy 4.5.0 Retail

    RegexBuddy正则汉化+注册

    RegexBuddy正则汉化+注册RegexBuddy正则汉化+注册RegexBuddy正则汉化+注册RegexBuddy正则汉化+注册

    RegexBuddy3

    RegexBuddy一款正则表达式编辑工具,帮助你的编写需要的正则表达式,还可以使用它理解别人编写的表达式。

    正则表达式学习工具RegexBuddy

    RegexBuddy它可以容易地建立你想要的正确的正则表达式。清晰地推断他人所写的复杂的正则表达式。它还可以用给出的实例字符串或文件快速地进行测试匹配,从而防止了在实际应用中出现错误。RegexBuddy会在你的源代码中...

Global site tag (gtag.js) - Google Analytics