Get Entries From Any Section Matching a URL segment I have 2 issues that I need help with:


I want to load ENTRIES from any section where the first URL segment of the entry matches jobs.
I am using the code below to load any SECTION where the first URL segment matches jobs.  This code works to load the sections. I'm just wondering if there's a more efficient way to write this to load the sections.  This is separate from loading the entries.  I need to do both.

{% set allSections = craft.sections.getAllSections() %}

{% for section in allSections %}

{% set sectionURL = section.getUrlFormat()|split('/')[0] %}

{% if sectionURL == "jobs" %}
    {{ section.name }}
{% endif %}

{% endfor %}
To check if the word jobs is in the sectionUrl you can use twig's matches to create a regular expression that looks for jobs

{% set allSections = craft.sections.getAllSections() %}
{% for section in allSections %}
    {% set sectionURL = section.getUrlFormat()|split('/')[0] %}

    {% if sectionURL matches "/jobs/" %}
        {{ section.name }}
    {% endif %}

{% endfor %}