Regular expressions in Crystal Reports 8.5

I am trying to find all fields that have specific words in them, standing by themselves.  The list of words includes
Road
Street
View
Village

I would want

132 Beach Road
to show up (Road)

but not 132 Broadside Lane (Broad != road)

What we have now is something like where field LIKE "*ROAD*" which obviously gets too many hits.  I cannot figure out how to do word boundaries in Crystal reports.  Please help

I don't think the database it is accessing is SQL, but I'm not positive.
I82Much87Asked:
Who is Participating?
 
mlmccCommented:
"Road *"  will get Road at the front of the line like
Road A

"* Road" will get Road at the end
A Road

The only one it won't get is ROAD by itself.
To get that add "Road"

mlmcc
0
 
I82Much87Author Commented:
if {tblStudentAddress.ADDRESS_1} like ["*Alley*","*Apartment*","*Avenue*"] then "Y"

is how the code is currently structured
0
 
mlmccCommented:
Put spaces around the word
You could do it as

if {tblStudentAddress.ADDRESS_1} like ["* Alley *", "Alley *", "* Alley", "* Apartment *","Apartment *","* Apartment","* Avenue *","Avenue *","* Avenue"] then "Y"

That should cover Alley, Apartment and Avenue at the start, middle and end

mlmcc
0
 
I82Much87Author Commented:
Yes that would work if it's in the middle of the sentence.  But it would not work for Road at the end of a line, for instance.  Similarly there are some of the words that will be the first word in the line, so they would not have a leading space
0
 
I82Much87Author Commented:
I think this will work.  You didn't mention how to get the word Road in the middle of the line by itself, but I think if we modify your pattern and say "* Road *" that will work.

Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.