i’m accessing Regex fine, but it says RegexOptions doesn’t exist. Here’s my line of code:
tstring = Regex.Replace(tstring, replacedword, replacementword, RegexOptions.IgnoreCase);
If it isn’t available in Unity what would be an alternative to be able to ignore case?
That should work…let’s see… Yeah, works fine here.
–Eric
So this script attached to a game object in a empty scene doesn’t give you the error “Unknown Identifier: RegexOptions”?
var hi = "this is a String";
var replacement = "awsome string";
var replaced = "string";
function Start () {
Debug.Log(hi);
hi = Regex.Replace(hi, replaced, replacement, RegexOptions.IgnoreCase);
Debug.Log(hi);
}
I’m running Unity2.1.0f5 (16146).
I see…add this to the top:
import System.Text.RegularExpressions;
–Eric
thanks it works now.
It’s kinda odd that you have to import that for regexoptions but not regex itself…