You can talk about ManiaScript for ManiaPlanet here
Moderator: English Moderator
- Posts: 1872
- Joined: 25 Aug 2011, 21:45
- Manialink: exchange
- Location: Poland
A lot of creators would really appreciate if ManiaScript had a regular expressions namespace with some basic methods, like Match and Replace. A RegExp literal would be welcome, too.
Code: Select all
Text[Void] Match(Text Source, Text Pattern, Text Flags)
Text Replace(Text Source, Text Pattern, Text Flags, Text Replacement)
declare Message = "Some sort of :flags system is :now possible.";
declare FoundStuff = RegExp::Match(Message, ":.+", "g");
log(FoundStuff); // [":flags", ":now"]
declare Message = "Have you seen my $l[malicious.site]new map$l?"
declare LinkRemoved = RegExp::Replace(Message, "\$[lL]\[.+\]", "g", "");
log(LinkRemoved); // "Have you seen my new map?"
PS. An Integer of occurences would be appreciated for TextLib::Find() method, too.
- Posts: 1523
- Joined: 27 Sep 2013, 18:02
- Manialink: nerpson
- Location: France
We definitely need this!
This would help me a lot!
Users browsing this forum: No registered users and 2 guests