[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文件操作] 多重搜索替换工具rxrepl,完整支持Perl和Unicode

本帖最后由 aries215 于 2023-9-16 09:05 编辑

名称:rxrepl
官网:https://sites.google.com/site/regexreplace/  (谁能登录 请作者编译64bit版本呀)
下载:https://pan.baidu.com/s/1-9yMWDZimCvVDBEBvVKbYg?pwd=v5fq
示例:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=412996

    RXREPL: 正则表达式搜索替换命令行工具
    -----------------------------------------------------------------

    RXREPL is a command line tool to search and replace text in text
    files using Perl compatible regular expressions (PCRE).

    It has the following features:
        - Search using Perl Compatible Regular Expressions
        - Use group matching in replacement text
        - Supports Windows and Unix line endings
        - Unicode support
        - Accepts multiple search/replace arguments
        - Options may be provided in an options file
        - Scan for files
        - Preview mode



    PROGRAM OPTIONS

        Basic Options:
          -h [ --help ] arg          Option help (use with "all" or "options" arguments)
          -f [ --file ] arg             Input file (omit for console input)
          -o [ --output ] arg       Output file (omit for console output)
          -s [ --search ] arg       Search text as Perl compatible regular expression
          -r [ --replace ] arg       Replacement text
          -n [ --occurrence ] arg   Occurrence to replace
          -i [ --ignore-case ]       Ignore case for the search
          -c [ --case-sensitive ]   Use a case sensitive search
          -a [ --alter ]                Alter original input file
          -p [ --preview ]           Preview the operation of the tool
          -P [ --preview-context ]  Show full context in preview

        File Scan Options:
          -D [ --dir ] arg         Search directory
          -I [ --include ] arg    Include files matching the wildcard specification
          -X [ --ext ] arg         Output file extension
          -R [ --recurse ]         Read all files under each directory, recursively
          -O [ --output-dir ] arg Output directory

        Advanced Options:
          -m [ --mode ] arg     Matching mode (line,file)
          --eol arg                  End of line sequence.
          -e [ --encoding ] arg Input file encoding (ansi,utf8,utf16le,utf16be,auto)
          --output-encoding arg Output file encoding (ansi,utf8,utf16le,utf16be,auto)
          --no-backup            Supress backup of input file
          --no-bom                Do not write unicode byte order mask (BOM)
          --return-count         Return the number of replacements made
          --options arg           Options file

          Multiple search and replace arguments may be provided.
          Use a Perl compatible regular expression (PCRE) as the search argument.
          The replacement argument text may include:
                  - Standard escape characters ( \\ \a \b \e \f \n \r \t \u???? \x?? )
                  - Pattern group matches ( \0 \1 \2 \{10} )

    OPTIONS FILE
   
    You can provide search and replace options via an options file.
    This allows you bypass the restrictions of the command line parser.
   
    You can include the following options in an options file:

      -s [ --search ] arg      Search text
      -r [ --replace ] arg     Replacement text
      -n [ --occurrence ] arg  Occurrence to replace
      -i [ --ignore-case ]     Ignore case for the search
      -c [ --case-sensitive ]  Use a case sensitive search

    The search and replace text may be delimited in various ways:

      --search(sample text)  -s[sample text] -s<sample text> -s{sample text}
      --replace|sample text| -r#sample text# -r~sample text~ -r:sample text:
      --search?sample text?  (where ? can be any printable character)

    LICENSE

    Author:   Ross MacGregor
    License:  Freeware, Unrestricted Use


    HISTORY

        Version 1.5: March 26, 2014
          - Added option to disable unicode byte order mask (BOM).
          - Depricated use of option --nobackup for new option --no-backup

    Version 1.4: January 13, 2014
      - Added and output file encoding option.

    Version 1.3: July 10, 2013
      - Added validation for out of order progam options.

    Version 1.2: June 29, 2013
      - Fixed problems with console I/O.
      - Changed method of selecting console I/O.
      - Added preview mode.

    Version 1.1: April 3, 2013
      - Support for standard input and standard output streams
      - Multi-line matching support. New "file" mode allows multi-line matches
        but requires entire file to be read into memory so it is not as
        efficient as "line" mode.
      - Buffered multi-line matching support not yet implemented (--mode buff).

    Version 1.0: November 12, 2012
      - Initial release
1

评分人数

    • CrLf: 感谢分享PB + 30

感谢分享,已收录到 http://bcn.bathome.net

TOP

标题漏了“多重”这一重要特色。

TOP

返回列表