`
dannyhz
  • 浏览: 387838 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

\/\*.*\*\/ 正则表达式 notepad++

 
阅读更多
在notepad++ 里使用这样的替换 ctrl+h
\/\*.*\*\/

可以替换掉 /* 里面任何 */

引用


/*     */   public static String requestPost(String params, HttpURLConnection httpConn, String encode)
   /*     */     throws Exception
   /*     */   {
   /* 161 */     String result = "";
   /* 162 */     OutputStream output = null;
   /* 163 */     OutputStreamWriter writer = null;
   /* 164 */     InputStream input = null;
   /* 165 */     InputStreamReader iReader = null;
   /* 166 */     BufferedReader bReader = null;
   /* 167 */     StringBuffer rBuffer = new StringBuffer();
   /* 168 */     String line = null;
   /* 169 */     logger.debug("请求地址:" + httpConn.getURL().getPath());
   /* 170 */     logger.debug("请求参数:" + params);
   /*     */     try {
   /* 172 */       output = httpConn.getOutputStream();
   /* 173 */       writer = new OutputStreamWriter(output);
   /* 174 */       writer.write(params);
   /* 175 */       writer.flush();
   /* 176 */       input = httpConn.getInputStream();
   /* 177 */       iReader = new InputStreamReader(input, encode);
   /* 178 */       bReader = new BufferedReader(iReader);
   /* 179 */       while ((line = bReader.readLine()) != null) {
   /* 180 */         rBuffer.append(line);
   /*     */       }
   /* 182 */       result = rBuffer.toString();
   /* 183 */       logger.debug("请求结果:" + result);
   /* 184 */       return result;
   /*     */     } catch (Exception e) {
   /* 186 */       logger.error(e.getMessage(), e);
   /* 187 */       return "";
   /*     */     } finally {
   /* 189 */       if (output != null) output.close();
   /* 190 */       if (writer != null) writer.close();
   /* 191 */       if (input != null) input.close();
   /* 192 */       if (iReader != null) iReader.close();
   /* 193 */       if (bReader != null) bReader.close();
   /* 194 */       httpConn.disconnect();
   /*     */     }
   /*     */   }  





引用


    public static String requestPost(String params, HttpURLConnection httpConn, String encode)
        throws Exception
      {
        String result = "";
        OutputStream output = null;
        OutputStreamWriter writer = null;
        InputStream input = null;
        InputStreamReader iReader = null;
        BufferedReader bReader = null;
        StringBuffer rBuffer = new StringBuffer();
        String line = null;
        logger.debug("请求地址:" + httpConn.getURL().getPath());
        logger.debug("请求参数:" + params);
        try {
          output = httpConn.getOutputStream();
          writer = new OutputStreamWriter(output);
          writer.write(params);
          writer.flush();
          input = httpConn.getInputStream();
          iReader = new InputStreamReader(input, encode);
          bReader = new BufferedReader(iReader);
          while ((line = bReader.readLine()) != null) {
            rBuffer.append(line);
          }
          result = rBuffer.toString();
          logger.debug("请求结果:" + result);
          return result;
        } catch (Exception e) {
          logger.error(e.getMessage(), e);
          return "";
        } finally {
          if (output != null) output.close();
          if (writer != null) writer.close();
          if (input != null) input.close();
          if (iReader != null) iReader.close();
          if (bReader != null) bReader.close();
          httpConn.disconnect();
        }
      }  

分享到:
评论

相关推荐

    Notepad++.zip解压即用版

    这个“Notepad++.zip解压即用版”提供了方便快捷的安装方式,用户无需进行复杂的安装过程,只需将压缩包解压到任意位置即可立即开始使用。 Notepad++的特点和功能: 1. **多语言支持**:Notepad++内置了对多种编程...

    Notepad++.zip

    这个名为"Notepad++.zip"的压缩包文件包含了Notepad++编辑器的安装程序或者更新文件。 Notepad++的核心特性包括: 1. **多语言支持**:它不仅支持常见的编程语言如C++, Java, Python, PHP等,还允许用户自定义语言...

    小绿本.zip / notepad++.exe

    8. **搜索与替换**:Notepad++的搜索功能强大,支持正则表达式,可以实现全文搜索和替换,这对于处理大量文本数据时非常有用。 9. **自定义快捷键**:用户可以根据个人习惯设置快捷键,提高工作效率。 10. **轻量...

    Notepad++(npp.8.4.1.portable.arm64.7z)

    - **搜索和替换**:提供了强大的查找和替换功能,支持正则表达式,便于进行文本操作。 - **多文档界面**:可以同时打开并编辑多个文件,方便对比和修改。 - **Unicode支持**:能够处理各种编码的文件,包括UTF-8和...

    notepad正则表达式使用

    Notepad++ 是一款功能强大的文本编辑器,支持正则表达式的使用,这极大地提高了文本处理的效率。 #### 正则表达式基本元素 正则表达式由普通的字符(如字母、数字等)和特殊的字符(元字符)组成。元字符具有特殊的...

    notepad+++.rar

    8. **正则表达式搜索与替换**:Notepad++的查找和替换功能支持正则表达式,使得高级搜索和替换操作变得简单。 9. **UTF-8编码支持**:Notepad++默认使用无BOM的UTF-8编码,可以处理各种语言的字符集,对于国际化...

    notepad++ .8.4.4 windows x64 arm64两个版本

    标题提到的"notepad++.8.4.4 windows x64 arm64两个版本"意味着这个压缩包包含了Notepad++的最新版本8.4.4,分别适配于两种不同的处理器架构:x64(64位)和arm64(64位ARM架构)。 1. **Notepad++ 8.4.4 版本更新*...

    NOTEPAD++正则法则:第一个和最后一个

    在Notepad++这款流行的文本编辑器中,使用正则表达式是处理和变换文本数据的一种强大工具。本文将着重讲解如何利用正则表达式的高级技巧,在Notepad++中对文本行进行精确的模式匹配和替换操作,尤其是对于每行中的第...

    文本编辑.Notepad++.7.7.1.x64.开源文本编辑器简体中文解压版.7z

    - **查找与替换**:强大的查找和替换功能,支持正则表达式,使得复杂的文本操作变得简单。 - **宏功能**:录制和回放宏,自动化重复任务,提高工作效率。 - **代码折叠**:方便管理长代码,隐藏不需关注的部分。 ...

    NotePad++.rar

    5. **查找和替换**:强大的查找和替换功能,支持正则表达式,让文本处理变得更加灵活。 6. **插件支持**:Notepad++拥有丰富的插件库,可以扩展其功能,如FTP客户端、版本控制集成、代码折叠等。 7. **自定义...

    Notepad++.7.6.1.bin.x64And32.zip

    6. **正则表达式搜索与替换**:支持正则表达式,能进行复杂的文本查找和替换操作。 7. **自定义插件**:Notepad++拥有丰富的第三方插件库,如用于版本控制的SCM插件,或者用于调试的FTP/SFTP插件,可根据需求扩展...

    Notepad++ release 8.6.4 x64

    6. **查找与替换**:其强大的查找和替换功能,支持正则表达式,使得在大量文本中定位和替换特定内容变得轻而易举。 7. **自动完成**:对于常见的编程关键字,Notepad++ 提供了自动补全功能,有助于提高编码速度。 ...

    Notepad++.rar

    5. **查找和替换**:强大的查找和替换功能,支持正则表达式,使得在大量文本中查找和替换特定模式变得简单。 6. **宏功能**:用户可以录制和回放宏,实现一系列重复的操作,提高工作效率。 7. **拼写检查**:内置...

    Notepad++.7.6.1.bin.x32.rar

    5. **正则表达式搜索与替换**:Notepad++支持正则表达式,可以方便地查找和替换大量模式,这对于处理HTML中的批量修改非常有用。 6. **宏功能**:用户可以录制和播放宏,实现一系列重复性的操作,节省时间。 7. **...

    官方版Notepad++7.9.3.exe安装包windows系统64位

    3. **查找和替换**:强大的搜索功能,支持正则表达式,能快速定位和替换文本。 4. **宏支持**:录制和播放宏,可以自动化重复性任务。 5. **自定义快捷键**:根据个人习惯设置快捷键,提高工作效率。 6. **插件管理*...

Global site tag (gtag.js) - Google Analytics