replace(/^(.*?)\s?\(([^)]+)\)$/gi, "$1$2")
Takes XJ FC-X35 (1492) and returns XJ FC-X351492.
Remove the $2
to turn XJ FC-X35 (1492) into XJ FC-X35, if that's what you wanted instead.
Long explanation
^ // From the start of the string
( // Capture a group ($1)
.*? // That contains 0 or more elements (non-greedy)
) // Finish group $1
\s? // Followed by 0 or 1 whitespace characters
\( // Followed by a "("
( // Capture a group ($2)
[ // That contains any characters in the following set
^) // Not a ")"
]+ // One or more times
) // Finish group $2
\)$ // Followed by a ")" followed by the end of the string.