escapeRegex              package:Hmisc              R Documentation

_E_s_c_a_p_e_s _a_n_y _c_h_a_r_a_c_t_e_r_s _t_h_a_t _w_o_u_l_d _h_a_v_e _s_p_e_c_i_a_l _m_e_a_n_i_n_g _i_n _a _r_e_q_u_l_a_r _e_x_p_r_e_s_s_i_o_n.

_D_e_s_c_r_i_p_t_i_o_n:

     Escapes any characters that would have special meaning in a
     reqular expression.

_U_s_a_g_e:

     escapeRegex(string)
     escapeBS(string)

_A_r_g_u_m_e_n_t_s:

  string: string being operated on. 

_D_e_t_a_i_l_s:

     'escapeRegex' will escape any characters that would have special
     meaning in a reqular expression. For any string
     'grep(regexpEscape(string), string)' will always be true.

     'escapeBS' will escape any backslash '\backslash' in a string.

_V_a_l_u_e:

     The value of the string with any characters that would have
     special meaning in a reqular expression escaped.

_A_u_t_h_o_r(_s):

     Charles Dupont
      Department of Biostatistics
      Vanderbilt University

_S_e_e _A_l_s_o:

     'grep'

_E_x_a_m_p_l_e_s:

     string <- "this\\(system) {is} [full]."
     escapeRegex(string)

     escapeBS(string)

