// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // Creation Date: 26 March 2003 // // // // // // int isValidUiName(string $name) // // // Return true if the string is a valid user interface name. // A valid user interface name begins with a letter and is followed // letters, digits, underscores or spaces. // // // string $name The name string to test. // // // int : True if the name is valid, false otherwise. // // // // // isValidUiName("Name"); // Will succeed. // // isValidUiName(" Name"); // Will fail. // // isValidUiName("1 Name"); // Will fail. // // isValidUiName("New Name"); // Will succeed. // // isValidUiName("New_Name"); // Will succeed. // // isValidUiName("New Name 1"); // Will succeed. // // // global proc int isValidUiName(string $name) { string $regularExpression = "([a-zA-Z]+)([a-zA-Z0-9_ ])*"; return (isValidString($name, $regularExpression)); }