[Date Index] [Thread Index] [Author Index]
Re: error with regular expression within package
On Mar 13, 10:31 am, ramiro <ramiro.barran... at uvm.edu> wrote: > Hi, > > This must be very simple. But with package below, I get the following > error: > > << test.m > Syntax::stresc: Unknown string escape \w. > > Thanks, ramiro > > test.m: > > BeginPackage["testing`"] > test::usage="test[t]" > Begin["`Private`"] > > test[t_]:=StringCases[t,RegularExpression["\w+"]] > > End > > EndPackage Inside a string you have to use "\\" to get a backslash. Use "\\w+"