All,
Trying to explore Regular Expressions a little better . I can achieve what I want with a simple Contains() - but trying to see what the equivalent would be using Regular Expressions.
The regex I have doesn't work the way I expect it to , can somebody point me to the equivalent regex and explain what I have gotten wrong ?
Clear Log(); Clear Globals();
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
dt:city[2] = "aLBUQUERQUE";
CityList = dt:City << Get Values;
Des = list();
for(i = 1 , i <= N Items(CityList),i++,
If(!IsMissing(Regex(Char(CityList[i]),"^a|A[LB]*")),
Insert Into(Des,CityList[i]);
);
);
/*for(i = 1 , i <= N Items(CityList) , i++,
If(Contains(CityList[i],"aLB")|Contains(CityList[i],"ALB"),
Insert Into(Des,CityList[i]);
);
);*/
Show(Des);
//Close All(Data Tables,"No Save");
Best
Uday