Home > freetb4matlab > strings > regexptranslate.m

regexptranslate

PURPOSE ^

% Translate a string for use in a regular expression. This might

SYNOPSIS ^

function y = regexptranslate (op, x)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} {} regexptranslate (@var{op}, @var{s})
% Translate a string for use in a regular expression.  This might
% include either wildcard replacement or special character escaping.
% The behavior can be controlled by the @var{op} that can have the
% values
%
% @table @asis
% @item 'wildcard'
% The wildcard characters @code{.}, @code{*} and @code{?} are replaced
% with wildcards that are appropriate for a regular expression. 
% For example:
% @example
% @group
% regexptranslate ('wildcard', '*.m')
%      @result{} '.*\.m'
% @end group
% @end example
% 
% @item 'escape'
% The characters @code{$.?[]}, that have special meaning for regular
% expressions are escaped so that they are treated literally.  For example:
% @example
% @group
% regexptranslate ('escape', '12.5')
%      @result{} '12\.5'
% @end group
% @end example
% @end table
% @seealso{regexp, regexpi, regexprep}
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003