RegexSearch()
On this page
RegexSearch(pattern: String, text: String, all_matches: bool = false) -> VariantCompile and search a regular expression.
Returns: RegExMatch or null; Array of RegExMatch when all_matches is true.
RegexSearch("(KEY)-(\\d+)", "KEY-204")Use get_string/get_start/get_end on the match object. This is different from PCA Script’s dictionary result. Invalid patterns log an error and return null/empty.
ReadTextFile()#
ReadTextFile(path: String, default_value: String = "") -> StringRead the complete text of an accessible file.
Returns: String or fallback.
ReadTextFile("user://notes.txt", "")WriteTextFile()#
WriteTextFile(path: String, text: String) -> boolCreate/overwrite a text file, creating parent directories as needed.
Returns: Boolean success.
WriteTextFile("user://notes.txt", "Visited the archive.\n")This helper accepts user:// only and overwrites. Native FileAccess supports additional modes and platform permissions.
