Very close, try:

questionText = questionText.replace(/[0-9]/g, '');

replace doesn't work on the existing string, it returns a new one. If you want to use it, you need to keep it!
Similarly, you can use a new variable:

var withNoDigits = questionText.replace(/[0-9]/g, '');

One last trick to remove whole blocks of digits at once, but that one may go too far:

questionText = questionText.replace(/\d+/g, '');
Answer from Kobi on Stack Overflow
๐ŸŒ
Futurestud.io
futurestud.io โ€บ tutorials โ€บ remove-numbers-from-a-string-in-javascript-or-node-js
Remove Numbers From a String in JavaScript or Node.js
October 8, 2020 - A regular expression is a good way to find all numbers in the string and replace them: const greeting = 'Hello Marcus, welcome in 2020'; const withoutNumbers = greeting.replace(/\d+/g, '') // or (works the same way and is a bit more verbose) const withoutNumbers = greeting.replace(/[0-9]/g, '') // withoutNumbers = 'Hello Marcus, welcome in ' The \d RegEx matches any number. The + modifier is a flag to match all adjacent numbers.
Discussions

Strip all non-numeric characters from string in JavaScript - Stack Overflow
Consider a non-DOM scenario where you'd want to remove all non-numeric characters from a string using JavaScript/ECMAScript. Any characters that are in range 0 - 9 should be kept. var myString = '... More on stackoverflow.com
๐ŸŒ stackoverflow.com
regex - How to remove all numbers and all text from string by using javascript replace? - Stack Overflow
Hot to remove all number and all text from stringby using javascript replace javascript ? https://jsfiddle.net/jgcsw41s/ Try it More on stackoverflow.com
๐ŸŒ stackoverflow.com
Regex for removing numbers and punctuation from strings/removing extra spaces and tabs
Can you please post a sample of the text you're getting and what you want to it to look like? More on reddit.com
๐ŸŒ r/learnjavascript
4
3
November 17, 2021
jquery - Removing Numbers from a String using Javascript - Stack Overflow
How do I remove numbers from a string using Javascript? I am not very good with regex at all but I think I can use with replace to achieve the above? It would actually be great if there was somet... More on stackoverflow.com
๐ŸŒ stackoverflow.com
People also ask

What is the best free editor for JavaScript?
Visual Studio Code is the industry standard with IntelliSense, debugger, terminal, Git, and a huge extension marketplace. JetBrains WebStorm is more powerful and free for students with a verified .edu email. For quick scratchpad work, Chrome DevTools Sources panel includes a workspace and breakpoint debugger.
๐ŸŒ
itsourcecode.com
itsourcecode.com โ€บ home โ€บ how to remove numbers from string in javascript
Remove Numbers from String in JavaScript (2026 Guide)
How do I run JavaScript locally vs in the browser?
In the browser: open DevTools (F12), Console tab, paste code, Enter. For HTML pages, add a script tag pointing to your .js file. Locally: install Node.js (LTS), then node script.js in your terminal from the file folder.
๐ŸŒ
itsourcecode.com
itsourcecode.com โ€บ home โ€บ how to remove numbers from string in javascript
Remove Numbers from String in JavaScript (2026 Guide)
Which JavaScript version should I target in 2026?
Target ES2020 (ES11) as the safe baseline because every modern browser and Node.js 14+ supports it fully. ES2022 adds top-level await, private class fields with #, and the .at() array method. For older browsers, transpile with Babel or use Vite, esbuild, or webpack.
๐ŸŒ
itsourcecode.com
itsourcecode.com โ€บ home โ€บ how to remove numbers from string in javascript
Remove Numbers from String in JavaScript (2026 Guide)
๐ŸŒ
Itsourcecode
itsourcecode.com โ€บ home โ€บ how to remove numbers from string in javascript
Remove Numbers from String in JavaScript (2026 Guide)
2 weeks ago - Regular expressions provide a dynamic way to search for and employ strings in JavaScript. We can use the replace() method along with a regular expression pattern to remove numbers from a string.
๐ŸŒ
Code Highlights
code-hl.com โ€บ home โ€บ javascript โ€บ tutorials
How to Remove Numbers from String JavaScript for Cleaner Data | Code Highlights
August 19, 2024 - newSubstr: This is what we want to replace the matched characters with. Here, we use an empty string ('') to remove the numbers. Return Value: The method returns a new string with the specified replacements. Hereโ€™s a straightforward example that removes all digits from a string:
๐ŸŒ
Bobby Hadz
bobbyhadz.com โ€บ blog โ€บ javascript-remove-all-characters-except-numbres
Remove all non-numeric characters from String in JavaScript | bobbyhadz
Use the String.replace() method to remove all non-numeric characters from a string. The String.replace() method will remove all characters except the numbers in the string by replacing them with empty strings.
๐ŸŒ
Codegive
codegive.com โ€บ blog โ€บ js_remove_numbers_from_string.php
js remove numbers from string: Unlock Clean Data & UI in JavaScript - The Ultimate Guide!
To remove numbers from a string in JavaScript, you can use the replace() method with a regular expression like /\d/g or /[0-9]/g to find and replace all digits with an empty string.
Find elsewhere
๐ŸŒ
YouTube
youtube.com โ€บ watch
Remove Numbers From Strings - YouTube
This video shows how to take multiple elements, remove numbers from each text, trim those strings, and confirm them. cy.get('#fruit li') // jQuery Element[]
Published ย  July 20, 2023
๐ŸŒ
RSWP Themes
rswpthemes.com โ€บ home โ€บ javascript tutorial โ€บ how to remove numbers from string in javascript
How to Remove Numbers From String in Javascript
November 20, 2023 - In this article, weโ€™ll explore various techniques and methods to achieve this in JavaScript. ... One of the most powerful and flexible ways to remove numbers from a string is by leveraging regular expressions.
๐ŸŒ
YouTube
youtube.com โ€บ watch
Extract number from string JavaScript - Learn how to extract or remove numbers from strings - YouTube
In this tutorial, weโ€™ll be looking at how to extract numbers from a string in JavaScript. This is a detailed tutorial that covers all the possible methods of...
Published ย  June 13, 2022
๐ŸŒ
Tutorial Reference
tutorialreference.com โ€บ javascript โ€บ examples โ€บ faq โ€บ javascript-how-to-remove-or-replace-all-numbers-in-string
How to Remove or Replace All Numbers in a String in JavaScript | Tutorial Reference
To replace every individual digit, ... replacement, add a + quantifier: string.replace(/\d+/g, '...'). To remove the numbers, simply provide an empty string ('') as the replacement value....
๐ŸŒ
tutorialpedia
tutorialpedia.org โ€บ blog โ€บ how-to-remove-numbers-from-a-string
How to Remove Numbers from a String in JavaScript Using Regex: Step-by-Step Guide โ€” tutorialpedia.org
Assuming \d Matches All Numeric Characters: As noted earlier, \d only matches 0-9 by default. Use Unicode property escapes (\p{Nd}/gu) for broader numeric coverage. To remove numbers from a string in JavaScript using regex:
๐ŸŒ
Reddit
reddit.com โ€บ r/learnjavascript โ€บ regex for removing numbers and punctuation from strings/removing extra spaces and tabs
r/learnjavascript on Reddit: Regex for removing numbers and punctuation from strings/removing extra spaces and tabs
November 17, 2021 -

I'm currently trying to get all the words from a webpage and having a bit of trouble removing some of the unnecessary things on the webpage.

Say I'm trying to get all the words on the Reddit Wikipedia:

https://en.wikipedia.org/wiki/Reddit

To get the text, I'd do text=document.body.innerText.

I would do removeStuff =text.replace(/(?:\r\n|\r|\n)/g, ' ') to remove some of the new lines and tabs, but after a while, it starts showing up again. There's also some punctuation and numbers that I want removed, but not sure how to approach it.

๐ŸŒ
CSS-Tricks
css-tricks.com โ€บ snippets โ€บ javascript โ€บ strip-numbers-from-a-string
Strip Numbers from a String | CSS-Tricks
August 30, 2012 - โ†’ JavaScript ยท โ†’ Strip Numbers from a String ยท Chris Coyier on Aug 30, 2012 ยท var someString = "Hello 123 World!"; newString = someString.replace(/[0-9]/g, ''); // console.log(newString); // "Hello World!"; Psst! Create a DigitalOcean account and get $200 in free credit for cloud-based hosting and services.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript-strip-all-non-numeric-characters-from-string
JavaScript โ€“ Strip All Non-Numeric Characters From String | GeeksforGeeks
November 27, 2024 - We will have a string and we need to print the numbers that are present in the given string in the console.Below are the methods to extract a number from string using JavaScript:Table of ContentUsing JavaScript match method with regExUsing ... In this article, we are given a string containing some non-ASCII characters and the task is to remove all non-ASCII characters from the given string.