View Single Post
Old 01-31-2022, 01:29 AM   #1
slantybard
my parent's oops...
slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.slantybard ought to be getting tired of karma fortunes by now.
 
Posts: 492
Karma: 1477572
Join Date: Feb 2009
Device: Vx->Handera->Clie-> Axim->505->650->KPW/Aura ->L2->iOS/CBW
Regex term for batch identifying word count in comments

I am trying to clean up my comments and want to remove word counts from some of them. For example, I have some books where the end of the comments have:

"x,xxx Words" or "xx,xxx Words" or "xxx,xxx Words"

I know I can use (\d+) to select all numbers....but....this also selects any other random numbers, dates, or chapter numbers that might be present as well.

Is there a specific regex that would only select the phrase "x,xxx Words" or "xx,xxx Words" or "xxx,xxx Words" where the x=any digit?

A specific example of what I'm looking for would be seen in this book comment:

Quote:
This is an extremely AU crossover fic that asks the question what might have happened if Petunia Dursley hadn't found a young Harry Potter sleeping on her doorstep on the morning of the 2nd of November 1981. After all, Dumbledore was a bit careless with him 109,446 Words
Here, I want to use a regex to delete the "109,446 Words" but leave the "2nd" and "1981" alone.

I don't mind splitting up the regex into several searches depending on number of words. Any suggestions or links to where I can find an answer would be appreciated.
slantybard is offline   Reply With Quote