solucion: in JavaScript and uses regular expressions to remove the dollar sign from a string. However, there are a few issues with the code that could be causing it to return "undefined".
Firstly, the code is written as an anonymous function with no name, and it is not clear how you are invoking this function. In order to use the code, you should either give the function a name and call it explicitly, or place the code inside a script tag in your HTML file so that it runs automatically when the page is loaded.
Secondly, the regular expression in the code is looking for digits, commas, and periods within the string, but it is not explicitly looking for a dollar sign. If your variable {{Booking Price}} includes a dollar sign, you should modify the regular expression to include it. For example, you could change the regex variable to:
var regex = /\$?([0-9.,]+)/;
This regex will match an optional dollar sign followed by one or more digits, commas, or periods.
Lastly, if the {{Booking Price}} variable does not include a valid price value that matches the regular expression, the function will return undefined. You should make sure that the variable is properly defined and contains a valid price value before invoking the function.