Ver Mensaje Individual
  #9  
Antiguo 12-10-2006
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 29
Lepe Va por buen camino
roman: supongo que conoces la unidad ConvUtils.pas, donde se puede crear conversiones entre unidades de medida, pesos, etc. Pues juraría que he visto la misma filosofía con expresiones regulares en Delphi 6 hace un par de años, lo encontré de pasada y no entendí la filosofía de uso, así que lo descarté.

Usando el Grep Search de GExpert he obtenido algunas cosas:

En BDS 2006 en la unidad Nsapi.pas, solo he podido encontrar esto:
Código Delphi [-]
{*****************************************************************************}
{* From shexp.h                                                               }
{*****************************************************************************}
{
  Defines and prototypes for shell exp. match routines


  This routine will match a string with a shell expression. The expressions
  accepted are based loosely on the expressions accepted by zsh.

  o * matches anything
  o ? matches one character
  o \ will escape a special character
  o $ matches the end of the string
  o [abc] matches one occurence of a, b, or c. The only character that needs
          to be escaped in this is ], all others are not special.
  o [a-z] matches any character between a and z
  o [^az] matches any character except a or z
  o ~ followed by another shell expression will remove any pattern
      matching the shell expression from the match list
  o (foo|bar) will match either the substring foo, or the substring bar.
              These can be shell expressions as well.

  The public interface to these routines is documented below.
}

{* --------------------------- Public routines ---------------------------- *}

{
  shexp_valid takes a shell expression exp as input. It returns:

   NON_SXP      if exp is a standard string
   INVALID_SXP  if exp is a shell expression, but invalid
   VALID_SXP    if exp is a valid shell expression
}

const
   NON_SXP = -1;
   INVALID_SXP = -2;
   VALID_SXP = 1;

{* and generic shexp/regexp versions *}
   NON_WILDPAT     = NON_SXP;
   INVALID_WILDPAT = INVALID_SXP;
   VALID_WILDPAT   = VALID_SXP;

{* and regexp versions *}
   NON_REGEXP      = NON_SXP;
   INVALID_REGEXP  = INVALID_SXP;
   VALID_REGEXP    = VALID_SXP;

function shexp_valid(exp: PChar): Integer; cdecl;

{
  shexp_match

  Takes a prevalidated shell expression exp, and a string str.

  Returns 0 on match and 1 on non-match.
}
function shexp_match(str, exp: PChar): Integer; cdecl;

{
  shexp_cmp

  Same as above, but validates the exp first. 0 on match, 1 on non-match,
  -1 on invalid exp. shexp_casecmp does the same thing but is case
  insensitive.
}
function shexp_cmp(str, exp: PChar): Integer; cdecl;
function shexp_casecmp(str, exp: PChar): Integer; cdecl;
****************************
function shexp_valid; external nshttp name 'shexp_valid';
function shexp_match; external nshttp name 'shexp_match';
function shexp_cmp; external nshttp name 'shexp_cmp';
function shexp_casecmp; external nshttp name 'shexp_casecmp';
****************************

En la unidad ToolsApi.pas he encontrado esto, aunque el prefijo "IOTA" me deja KO.
Código Delphi [-]
  IOTASearchOptions = interface(IUnknown)
    ['{D1766F8B-D915-11D2-A8C1-00C04FA32F53}']
    function GetCaseSensitive: Boolean;
    function GetDirection: TSearchDirection;
    function GetFromCursor: Boolean;
    function GetRegularExpression: Boolean;
    function GetSearchText: string;
    function GetWholeFile: Boolean;
    function GetWordBoundary: Boolean;
    procedure SetCaseSensitive(Value: Boolean);
    procedure SetDirection(Value: TSearchDirection);
    procedure SetFromCursor(Value: Boolean);
    procedure SetRegularExpression(Value: Boolean);
    procedure SetSearchText(const Value: string);
    procedure SetWholeFile(Value: Boolean);
    procedure SetWordBoundary(Value: Boolean);

    property CaseSensitive: Boolean read GetCaseSensitive write SetCaseSensitive;
    property Direction: TSearchDirection read GetDirection write SetDirection;
    property FromCursor: Boolean read GetFromCursor write SetFromCursor;
    property RegularExpression: Boolean read GetRegularExpression write SetRegularExpression;
    property SearchText: string read GetSearchText write SetSearchText;
    property WholeFile: Boolean read GetWholeFile write SetWholeFile;
    property WordBoundary: Boolean read GetWordBoundary write SetWordBoundary;
  end;

En dotNet\rtl\Borland.Vcl.Masks.pas tambien he encontrado cosas, pero en Delphi 6 no estará, que precisamente es donde recuerdo haberlo visto.

¿Podrías realizar algunas búsquedas en Delphi 6 para comprobar si existen lo que he encontrado? Gracias.

Saludos
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita