Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module allows you to use regular expressions to manipulate and filter data within Drupal views. You can define custom text outputs based on regex replacements or create filters that include or exclude rows matching specific regex patterns.

Views Regex Functions is a simple module that allows you to define regex replacements with fields in views. In other words, it allows you to output text based on the result of a regex replacement formula. Additionally, you can filter using regex expressions.

Please Note: This module requires no modules outside of Drupal core.

Table of contents

  • Requirements
  • Installation
  • Configuration
  • Features
  • Works With
  • Use Case Examples
  • Supporting Organizations

Installation

Install as you would normally install a contributed Drupal module. For further information, see Installing Drupal Modules.

Configuration

  • Navigate to Administration » Structure » Views and create a view.
  • Add some fields under "FIELDS".
    OR
    Add some filters under “FILTERS”.
  • Select "ADD". Scroll down to "Views: Views Regex Functions", found near the bottom of the list.
  • Add and configure fields or filters.
  • Choose a field to run a condition against, and provide values accordingly.
  • Save, views regex functions handles the logic and returns as specified.

Features

  • Field with Regex Function: This feature allows you to use a PHP Regex expression to manipulate data that shows up in a view.
  • Filter with Regex Function: This feature allows you to remove rows that match or only show rows that match a PHP Regex function. (Uses the views_post_execute hook.)

Works With

Here is a list of modules that this module works well with:

PLEASE Help Us: If you find other modules this works well with and should be added to this list, please submit an issue with the following setup for this screen to be updated:

  • Category: Task
  • Priority: Normal
  • Status: Reviewed & tested by the community
  • Component: Documentation
  • Assigned: tylerhastain

Documentation

Views Regex Functions Documentation

Supporting this Module

If this module saves you time or adds value to your project, you can show your support in two ways:

  • Buy me a coffee to say thanks:
    https://buymeacoffee.com/tylerhastain
  • Want to contribute or sponsor development?
    Reach out directly if you're interested in helping improve or maintain the module — contributions, ideas, and support are always welcome!

Activity

Total releases
2
First release
Feb 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Release date
1.2.0 Stable Feb 21, 2025
1.2.x-dev Dev Feb 21, 2025