o1-preview-2024-09-12· OpenAI
WildChat-4.8M (AI2)
Write an assembly script that extracts all kinds of numbers from a string: JS version:…
- User
Write an assembly script that extracts all kinds of numbers from a string:
JS version:
function extractNumbersFromString(string) { return string.match(/-?\d+(.\d+)?/g).map(n => Number(n)); }
Convert it to Assembly
- Assistant
Here's an AssemblyScript function that extracts all kinds of numbers from a string, similar to your JavaScript function: