Regex Library Datapack 图标

Regex Library Datapack

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 0.1.2
本资源为搬运资源,原资源地址: https://modrinth.com/mod/regex
资源信息

Minecraft 版本: 1.21

平台: datapack

标签: library utility

资源介绍

This library requires Moxlib to function.

GMDU Regex Library

by Gears and Moxvallix.

Overview

This library provides a simple regular expression parser, working entirely in mcfunction.

Current Features and Metacharacters

Character Example Description
[] [abc] Character set
[^] [^abc] Inverted character set
[x-y] [A-Z] Character range
() (ab) Group
. . Wildcard
\| (a\|b) Or
^ ^abc Beginning of string
$ xyz$ End of string
? ab? Zero or one of the preceding token
* ab* Zero or more of the preceding token
+ ab+ One or more of the preceding token
\ \+ Escape following character

If you need help creating your regex pattern, we recommend using RegExr.

Not all features from RegExr are supported in our library, see table above.

Getting Started

This library uses a simple api. The string to match is given in target,
and the regex to match with is set in pattern. These are set in the storage,
regex:api/match

To run the match, run function regex:api/match.

Example

data modify storage regex:api/match target set value "Hello, World!"
data modify storage regex:api/match pattern set value "[A-Za-z]+"
function regex:api/match
{
  success: 1b,
  output: ["H","e","l","l","o"]
}
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
ProxyPortal

价格:0 墨喵币
下载量:0

查看详情
Overworld Quartz

价格:0 墨喵币
下载量:0

查看详情
SuperSponge

价格:0 墨喵币
下载量:0

查看详情
MCTweaks | Refined Recipes & Drops

价格:0 墨喵币
下载量:0

查看详情