All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.skillw.pouvoir.util.read.RegexUtil.kt Maven / Gradle / Ivy

There is a newer version: 1.6.7-beta-6
Show newest version
package com.skillw.pouvoir.util.read

import java.util.regex.Pattern

/**
 * @className RegexUtil
 *
 * @author Glom
 * @date 2023/8/8 20:22 Copyright 2024 Glom. 
 */

val groupPattern = "\\(\\?<([a-zA-Z][a-zA-Z0-9]*)>".toRegex()

fun Pattern.groupNames(): Set = groupPattern.findAll(pattern()).map { it.groupValues[1] }.toSet()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy