I am developing a web application for a school. They have terms like course_name
and class_name
. Think of a course as a template for a class, meaning that a class must inherit most attributes of a course.
Now, the class_name
MUST contain the course_name
. For example: if course_name is "CSS" then the class_name can be "CSS 101" or "Beginning CSS". Checking for this is easy using regular expressions. I used to use word boundaries \b\b.
However, I recently ran into an issue where the user typed "HTML (Beginner)" as the course_name
. \b being a word boundary will no longer work in this case to find a match in the class_name
. Can someone please help me on this? My brain is exploding thinking of all the possibilities. The solution should cover most, if not all, scenarios.
-Mark