Regular Expressions
To help the users with matching, specifying and recognizing strings of text; such as particular characters, words, or patterns of characters; Mosrif supports RegExp as a native feature.
A regular expression, often called a pattern, is an expression that specifies a set of strings.
Example of the String.replace with regular expression, that will convert each Fahrenheit to Celsius number in the given string (s):
var s = "25.5K";
// regEsp command, find whole or decimal number and split to two parameters
var regEsp = /(\d+)?(([.])?\d+)/g;
// convert kelvin to celsius
function k2c(str, g, z)
{
// if number is decimal, z contains decimal part, otherwise it contains last character
var number = g + z; // return converted value
return (number.toNumber() - 273.15) + "C";
}
// replace value
console<