Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Regular expressions in Crystal Reports 8.5

Posted on 2009-02-10
Medium Priority
Last Modified: 2012-05-06
I am trying to find all fields that have specific words in them, standing by themselves.  The list of words includes

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.
Question by:I82Much87
  • 3
  • 2

Author Comment

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

is how the code is currently structured
LVL 101

Expert Comment

ID: 23603376
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


Author Comment

ID: 23604609
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
LVL 101

Accepted Solution

mlmcc earned 750 total points
ID: 23606562
"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"


Author Closing Comment

ID: 31545103
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.


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question