Turn an Express-\/style path string such as {\ttfamily /user/\+:name} into a regular expression.

{\bfseries{Note\+:}} This is a legacy branch. You should upgrade to {\ttfamily 1.\+x}.\hypertarget{md_sfcode_node_modules_path_to_regexp_Readme_autotoc_md20316}{}\doxysection{Usage}\label{md_sfcode_node_modules_path_to_regexp_Readme_autotoc_md20316}

\begin{DoxyCode}{0}
\DoxyCodeLine{var pathToRegexp = require('path-\/to-\/regexp'); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_path_to_regexp_Readme_autotoc_md20317}{}\doxysubsection{path\+To\+Regexp(path, keys, options)}\label{md_sfcode_node_modules_path_to_regexp_Readme_autotoc_md20317}

\begin{DoxyItemize}
\item {\bfseries{path}} A string in the express format, an array of such strings, or a regular expression
\item {\bfseries{keys}} An array to be populated with the keys present in the url. Once the function completes, this will be an array of strings.
\item {\bfseries{options}}
\begin{DoxyItemize}
\item {\bfseries{options.\+sensitive}} Defaults to false, set this to true to make routes case sensitive
\item {\bfseries{options.\+strict}} Defaults to false, set this to true to make the trailing slash matter.
\item {\bfseries{options.\+end}} Defaults to true, set this to false to only match the prefix of the URL.
\end{DoxyItemize}
\end{DoxyItemize}


\begin{DoxyCode}{0}
\DoxyCodeLine{var keys = [];}
\DoxyCodeLine{var exp = pathToRegexp('/foo/:bar', keys);}
\DoxyCodeLine{//keys = ['bar']}
\DoxyCodeLine{//exp = /\string^\(\backslash\)/foo\(\backslash\)/(?:([\string^\(\backslash\)/]+?))\(\backslash\)/?\$/i }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_path_to_regexp_Readme_autotoc_md20318}{}\doxysection{Live Demo}\label{md_sfcode_node_modules_path_to_regexp_Readme_autotoc_md20318}
You can see a live demo of this library in use at \href{http://forbeslindesay.github.com/express-route-tester/}{\texttt{ express-\/route-\/tester}}.\hypertarget{md_sfcode_node_modules_path_to_regexp_Readme_autotoc_md20319}{}\doxysection{License}\label{md_sfcode_node_modules_path_to_regexp_Readme_autotoc_md20319}
MIT 