Solved Error with regex

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

FinalPlayer024

Active Member
Oct 19, 2017
94
4
0
How does "Regex replace" work?
I've already tried it using
code_language.skript:
on chat:
  regex replace "\d{1,3}" with "test" in message
           #This regex should replace all the numbers {wrote 1, 2 or 3 times} in message with "test"

But all I have is "Can't understand this condition/effect ecc..."


Instead, this works fine
code_language.skript:
on chat:
  message regex matches "\d{1,3}":
    broadcast "Regex matches some numbers"
But it would be really useful if I could replace the text with something else



(Hope you understand, I'm Italian rip)
 
Last edited:
Regex replace isnt an effect, it's an expression. So you have to use
code_language.skript:
set message to regex replace "\d{1,3}" with "test" in message
 
Status
Not open for further replies.