Partial match in URL getSegment() Is there a way to partially match text in a URL segment? I would like to conditionally show code if the text "vascular" is in Segment 3.

If my URL is: https://website.com/segment1/segment2/10009-vascular-access

This is what I've tried so far...

{% if craft.request.getSegment(3) == 'vascular' %}

{% if craft.request.getSegment(3).contains("vascular") %}
You should be able to utilize twig's built-in containment operator.

Your code would look like this:

{% if 'vascular' in craft.request.getSegment(3) %}
    ...
{% endif %}


Here is official documentation on the containment operator: http://twig.sensiolabs.org/doc/templates.html#containment-operator.