A simple action that looks for multiple regex matches, in a input text, and returns the key of the first found match.

Key Match Action

A simple action that looks for multiple regex matches, in a input text, and returns the key of the first found match.

TO RUN

Add the step to your github action yml

steps:
  - name: Manual Action Test
    id: match
    uses: ChristofferDahlen/Multi-Regex-Match@v1
    with:
      input: "This is the test string. It contains cats "
      json_match: '{ "(?i)(dog|cat)" : "animal", "(?i)(volvo|BMW)" : "(volvo|BMW)"}' # Imbedded json 

The output can then be acessed as ${{ steps.match.outputs.result }}

Parameters

Input Description Required
json_match A json string containing a key-value pairs. The key is the regex expression used for matching (javascript style). The value is the returned output if it has been sucessfully matched. It returns only the first match. If you want to use flags they are embedded as for example /[\W]*/im yes
input The input string that is used to match against yes
Ouput Description
result The key of the first found match

Json matching format

The regex is in the golang dialect

{ 
"Regexp 1" : "outValue",
"Regexp 2" : "outValue", 
...
}
Similar Resources

NERV Editor - A simple but peculiar text editor

NERV Editor - A simple but peculiar text editor

nerved a simple but peculiar text editor introduction nerved is a text editor bu

Oct 24, 2022

A general purpose application and library for aligning text.

align A general purpose application that aligns text The focus of this application is to provide a fast, efficient, and useful tool for aligning text.

Sep 27, 2022

Parse placeholder and wildcard text commands

allot allot is a small Golang library to match and parse commands with pre-defined strings. For example use allot to define a list of commands your CL

Nov 24, 2022

omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc.

omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc.

omniparser Omniparser is a native Golang ETL parser that ingests input data of various formats (CSV, txt, fixed length/width, XML, EDI/X12/EDIFACT, JS

Jan 4, 2023

Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.

Produces a set of tags from given source. Source can be either an HTML page, Markdown document or a plain text. Supports English, Russian, Chinese, Hindi, Spanish, Arabic, Japanese, German, Hebrew, French and Korean languages.

Tagify Gets STDIN, file or HTTP address as an input and returns a list of most popular words ordered by popularity as an output. More info about what

Dec 19, 2022

Templating system for HTML and other text documents - go implementation

FAQ What is Kasia.go? Kasia.go is a Go implementation of the Kasia templating system. Kasia is primarily designed for HTML, but you can use it for any

Mar 15, 2022

Small and fast FTS (full text search)

Microfts A small full text indexing and search tool focusing on speed and space. Initial tests seem to indicate that the database takes about twice as

Jul 30, 2022

:book: A Golang library for text processing, including tokenization, part-of-speech tagging, and named-entity extraction.

prose prose is a natural language processing library (English only, at the moment) in pure Go. It supports tokenization, segmentation, part-of-speech

Jan 4, 2023

PipeIt is a text transformation, conversion, cleansing and extraction tool.

PipeIt is a text transformation, conversion, cleansing and extraction tool.

PipeIt PipeIt is a text transformation, conversion, cleansing and extraction tool. Features Split - split text to text array by given separator. Regex

Aug 15, 2022
gomtch - find text even if it doesn't want to be found

gomtch - find text even if it doesn't want to be found Do your users have clever ways to hide some terms from you? Sometimes it is hard to find forbid

Sep 28, 2022
Diff, match and patch text in Go

go-diff go-diff offers algorithms to perform operations required for synchronizing plain text: Compare two texts and return their differences. Perform

Dec 25, 2022
Super Fast Regex in Go

Rubex : Super Fast Regexp for Go by Zhigang Chen ([email protected] or [email protected]) ONLY USE go1 BRANCH A simple regular expression libr

Sep 9, 2022
A full-featured regex engine in pure Go based on the .NET engine

regexp2 - full featured regular expressions for Go Regexp2 is a feature-rich RegExp engine for Go. It doesn't have constant time guarantees like the b

Jan 9, 2023
:evergreen_tree: Parses indented code and returns a tree structure.

codetree Parses indented code (Python, Pug, Stylus, Pixy, codetree, etc.) and returns a tree structure. Installation go get github.com/aerogo/codetree

Sep 27, 2022
a simple and lightweight terminal text editor written in Go

Simple Text editor written in Golang build go build main.go

Oct 4, 2021
This is a simple text completion/editing/auto-correction tool I created in Go.
This is a simple text completion/editing/auto-correction tool I created in Go.

Auto Text Completion Tool This is a simple text completion/editing/auto-correction tool I created in Go. The tool receives the following arguments: Th

Oct 25, 2022
Simple text-to-ascii-art generator

Simple text-to-ascii-art generator

Nov 17, 2021
Arecibo: Simple text randomizer

Arecibo Arecibo: Simple text randomizer. Transforms This {article|website|newspaper} will give you the {most|best|most accurate} information about thi

Dec 8, 2021
Google GCP Text-to-Speech Service in one simple binary ;)

Google text-to-speak Simple Binary file This repository is a simple implementation of google text-to-speak service. Required enable API in GCP (https:

Dec 25, 2022