Regex Tools

logo

firefox_NV67RdkKHm

About

Collection of simple blocks that perform typical regex functions. Is under the Library Regex Tools

All of my (Kyle Mason) (mediatech15) blocks are free to copy modify and edit how you see fit. You may re-post the variants freely (an inspired by is nice)

Blocks

Match Check

firefox_eL9cErx9mx

Performs a test against the string for a match. This check automatically adds start and end of string chars to match an entire string ^...$
Returns: true|false

Usage

firefox_y5LyOT5O5i

Search Check

firefox_RkHfh56adX

Performs a test against the string for a match. The searches for the match in a larger string.
Returns: true|false

Usage

firefox_zKL6GIDOpt

Match

firefox_rFXYWS0pDh

Matches a regex against a string and provides all matches. Note: will provide empty list if no matches.
Returns: List

Usage

firefox_stKA8VzHg8

Replace All

firefox_3kMAxazBW7

Replaces every instance of the regex.
Returns: String

Usage

firefox_n0PON9xtBN

Changelog

Version 1.0

  • initial release

Resources

Latest

Gitlab Snippet (RAW)

v1.0

Gitlab Snippet

3 Likes

Thanks for the contribution.

Even though yours goes much further it should be noted that there is some support for REGEX also in the core blocks.

Correct. I felt it odd that I leave out one command that may be supported in core (though maybe not to same extent). Typically strive for complete packages. Does this make some overlap sure. But also the process to do it one way or another is now in the hands of the developer. Not trying to “replace” or “reinvent” core functionality but needed more so I made the “complete” package so it was all together.

Sure, I hear you :+1:, though there is block library guideline that says that core blocks should actually not be duplicated in a different way as it might confuse users that there are two different blocks that are basically doing the same.

Thats true. replaceAll being only one that steps on a toe. Id really hate to have to maintain two versions of the addon because of my use and “community upload rules”

I understand that but the guidelines have been created by @ysc for a reason. Please do me favor then to at least tell in the documentation that the block is equal in function to the core. Would that be a compromise you can live with?

I can definitely update docs and all. and in the end if I have to remove it then i will.

@ysc Will it be a problem to keep my replace all function in this? I do feel it is nice to have complete sets. Along with that it is named, colored, and visually different from the default block that provides similar functionality.