function hasIdInTitle(id) {
            const docText = cat(docFilename);
            const idOldAtEndOfTitleRegExp = new RegExp(`^# (.*?) \\(${id}\\)`, "u"); // original format
            const idNewAtBeginningOfTitleRegExp = new RegExp(`^# ${id}: `, "u"); // new format is same as rules index
            /*
             * 1. Added support for new format.
             * 2. Will remove support for old format after all docs files have new format.
             * 3. Will remove this check when the main heading is automatically generated from rule metadata.
             */

            return idNewAtBeginningOfTitleRegExp.test(docText) || idOldAtEndOfTitleRegExp.test(docText);
        }
function hasIdInTitle(id) {
            const docText = cat(docFilename);
            const idOldAtEndOfTitleRegExp = new RegExp(`^# (.*?) \\(${id}\\)`, "u"); // original format
            const idNewAtBeginningOfTitleRegExp = new RegExp(`^# ${id}: `, "u"); // new format is same as rules index
            /*
             * 1. Added support for new format.
             * 2. Will remove support for old format after all docs files have new format.
             * 3. Will remove this check when the main heading is automatically generated from rule metadata.
             */

            return idNewAtBeginningOfTitleRegExp.test(docText) || idOldAtEndOfTitleRegExp.test(docText);
        }
function hasIdInTitle ( id ) { const docText = cat ( docFilename ) ; const idOldAtEndOfTitleRegExp = new RegExp ( ` \\ ${ id } \\ ` , "u" ) ; // original format const idNewAtBeginningOfTitleRegExp = new RegExp ( ` ${ id } ` , "u" ) ; // new format is same as rules index /*
             * 1. Added support for new format.
             * 2. Will remove support for old format after all docs files have new format.
             * 3. Will remove this check when the main heading is automatically generated from rule metadata.
             */ return idNewAtBeginningOfTitleRegExp . test ( docText ) || idOldAtEndOfTitleRegExp . test ( docText ) ; }
Check if id is present in title
@param {string} id id to check for
@returns {boolean} true if present
@private
Check if id is present in title
Check if the doc has the given id in the title