Skip to content

Commit

Permalink
fix element.contains_text with regex
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 1, 2020
1 parent 47bfe56 commit 175d503
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Contribution to Denizen
-----------------------

Refer to the Denizen Bukkit contribution guide: https://github.com/DenizenScript/Denizen-For-Bukkit/blob/dev/CONTRIBUTING.md
Refer to the Denizen contribution guide: https://github.com/DenizenScript/Denizen/blob/dev/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,8 @@ public static void registerTags() {
registerTag("contains_text", (attribute, object) -> {
String element = object.element;
String contains = attribute.getContext(1);

if (CoreUtilities.toLowerCase(contains).startsWith("regex:")) {

if (Pattern.compile(contains.substring(("regex:").length()), Pattern.CASE_INSENSITIVE).matcher(element).matches()) {
if (Pattern.compile(contains.substring(("regex:").length()), Pattern.CASE_INSENSITIVE).matcher(element).find()) {
return new ElementTag("true");
}
else {
Expand Down

0 comments on commit 175d503

Please sign in to comment.