// =========================================================================== // 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 isValidObjectName(string $name) // // // Return true if the string is a valid object name. // A valid object name begins with a letter and is followed // letters, digits, or underscores. Spaces are not allowed. // // // string $name The name string to test. // // // int : True if the name is valid, false otherwise. // // // // // isValidObjectName("Name"); // Will succeed. // // isValidObjectName(" Name"); // Will fail. // // isValidObjectName("1 Name"); // Will fail. // // isValidObjectName("New Name"); // Will fail. // // isValidObjectName("New_Name"); // Will succeed. // // isValidObjectName("New Name 1"); // Will fail. // // // global proc int isValidObjectName(string $name) { string $regularExpression = "[a-zA-Z][a-zA-Z0-9_]*"; return (isValidString($name, $regularExpression)); }