⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 regexpr.pas

📁 Well known and usefull component for delphi 7
💻 PAS
📖 第 1 页 / 共 2 页
字号:
{$B-}
unit RegExpr;

(*
     TRegExpr library
     Regular Expressions for Delphi

     Author:
     Andrey V. Sorokin
     St-Petersburg
     Russia
     anso@mail.ru, anso@usa.net
     http://anso.da.ru
     http://anso.virtualave.net

This library is derived from Henry Spencer sources.
I translated the C sources into Object Pascal,
implemented object wrapper and some new features.
Many features suggested or partially implemented
by TRegExpr's users (see Gratitude below).

---------------------------------------------------------------
     Legal issues
---------------------------------------------------------------
 Copyright (c) 1999-00 by Andrey V. Sorokin <anso@mail.ru>

 This software is provided as it is, without any kind of warranty
 given. Use it at your own risk.

 You may use this software in any kind of development, including
 comercial, redistribute, and modify it freely, under the
 following restrictions :
 1. The origin of this software may not be mispresented, you must
    not claim that you wrote the original software. If you use
    this software in any kind of product, it would be appreciated
    that there in a information box, or in the documentation would
    be an acknowledgmnent like this
           Partial Copyright (c) 2000 by Andrey V. Sorokin
 2. You may not have any income from distributing this source
    to other developers. When you use this product in a comercial
    package, the source may not be charged seperatly.


---------------------------------------------------------------
     Legal issues for the original C sources:
---------------------------------------------------------------
 *  Copyright (c) 1986 by University of Toronto.
 *  Written by Henry Spencer.  Not derived from licensed software.
 *
 *  Permission is granted to anyone to use this software for any
 *  purpose on any computer system, and to redistribute it freely,
 *  subject to the following restrictions:
 *  1. The author is not responsible for the consequences of use of
 *      this software, no matter how awful, even if they arise
 *      from defects in it.
 *  2. The origin of this software must not be misrepresented, either
 *      by explicit claim or by omission.
 *  3. Altered versions must be plainly marked as such, and must not
 *      be misrepresented as being the original software.


---------------------------------------------------------------
     Gratitudes
---------------------------------------------------------------
  Guido Muehlwitz
    found and fixed ugly bug in big string processing
  Stephan Klimek
    testing in CPPB and suggesting/implementing many features
  Steve Mudford
    implemented Offset parameter
  Martin Baur
    usefull suggetions, help translation into German
  Yury Finkel
    Implemented UniCode support, found and fixed some bugs
  Ralf Junker
    Implemented some features, many optimization suggestions
  Filip Jirs醟 and Matthew Winter (wintermi@yahoo.com)
    Help in Implementation non-greedy mode
  Kit Eason
    many examples for introduction help section
  Juergen Schroth
    bug hunting and usefull suggestions
  Simeon Lilov
    help translation into Bulgarian
  Martin Ledoux
    help translation into French
  Diego Calp (mail@diegocalp.com), Argentina
    help translation into Spanish

  And many others - for big work of bug hunting !

I am still looking for person who can help me to translate
this documentation into other languages (especially German)


---------------------------------------------------------------
     To do
---------------------------------------------------------------

-=- VCL-version of TRegExpr - for dummies ;) and TRegExprEdit
(replacement for TMaskEdit).
Actually, I am writing non-VCL aplications (with web-based
interfaces), so I don't need VCL's TRegExpr for myself.
Will it be really usefull ?

-=- working with pascal-style string.
Now pascal-strings converted into PChar, so
you can't find r.e. in strings with #0 -chars.
(suggested by Pavel O).

-=- put precalculated lengths into EXACTLY[CI] !

-=- fInputString as string (suggested by Ralf Junker)

-=- Add regstart optimization for case-insensitive mode ?
 Or complitely remove because FirstCharSet is faster ?

-=- "Russian Ranges" --> National ranges (use property WordChars ?
for ordering letters in ranges by its order in WirdsChars if modifier /r is On)

-=- FirstCharSet as array [#0 .. #255] of REChar ?
(2x faster then set of REChar)

-=- p-code optimization (remove BRANCH-to-EEND, COMMENT, BACK(?)
    merge EXACTLY etc).

-=- !!!!!!!! bug found by Lars Karlslund
    "If I do '(something|^$)' on '' I get false (which is wrong ...)."

-=- There are no special command for files (Johan Smit).

I need your suggestions !
What are more importent in this list ?
Did I forget anything ?


---------------------------------------------------------------
     History
---------------------------------------------------------------
Legend:
 (+) added feature
 (-) fixed bug
 (^) upgraded implementation

 v. 0.947 2001.10.03
 -=- (+) Word boundary (\b & \B) metachar
 -=- (-) Bug in processing predefined char.classes in non-UseSetOfChar mode
 -=- (+) Spanish help - translated by Diego Calp (mail@diegocalp.com), Argentina
 -=- (+) VersionMajor/Minor class method of TRegExpr ;)
 -=- (-) Bug in CompileRegExpr, Thanks to Oleg Orlov <orlov@diasoft.ru>
 -=- (^) Method RegExprSubExpressions wasn't compatible with D2-D3.
  Thanks to Eugene Tarasov for bug report.
 -=- (+) Method Replace can now do substitution as well (see documentation)
  Thanks to Warren Bare, Ken Friesen and many others who suggested it.
 -=- (+) Updated ReplaceRegExpr to use new Replace method functionality
 -=- (^) Restored UniCode compatibility lost in some previous version
  Thanks to Stephan Klimek for bug report
 -=- (^) Updated TestRE project, new examples for Replace with substitution
  included.

 v. 0.942+ 2001.03.01
 -=- (+) Published French help for TRegExpr,
  translated by Martin Ledoux

 v. 0.942 2001.02.12
 -=- (-) Range-check error in DEMO-project (due to bug in
  RegExprSubExpressions), Thanks to Juergen Schroth
 -=- (^) RegExprSubExpressions - added error codes for "unclosed "[" error
 -=- (^) Help file bug fixing

 v. 0.941 2001.02.01
 -=- (^) Attension! Behaviour of '\w', '\W' was changed! Now it really
  match alphanum characters and '_' as described in documentation,
  not only alpha as it was before. Thanks to Vadim Alexandrov.
  If You want to restore previous behaviour, reassign
  RegExprWordChars (exclude '0123456789' from it).
 -=- (+) Full compatible with recommended at unicode.org implementation
  of modifier /m, including DOS-styled line separators (\r\n) mixed
  with Unix styled (\n) - see properties LineSeparators, LinePairedSeparator
 -=- (^) Attension! Behaviour of '.' was changed! Now if modifier /s is off
  it doesn't match all chars from LineSeparators and LinePairedSeparator (by
  default \r and \n)
 -=- (^) Attension! To prevent unneeded recompilation of r.e., now assignment
  to Expression or changing modifiers doesn't cause immidiate [re]compilation.
  So, now You don't get exception while assigning wrong expression, but can
  get exception while calling Exec[Next], Substitute, Dump, etc if there
  are errors in Expression or other properties.
 -=- (+) Non-greedy style iterators (like '*?'), modifier /g.
  Implemented with help from Matthew Winter and Filip Jirs醟
 -=- (+) /x modifier (eXtended syntax - allow formating r.e., see description

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -