Wildcard search for [dd], d=digit

Discuss the word processor
Post Reply
sydcarten
Posts: 12
Joined: Fri Aug 28, 2015 1:59 am

Wildcard search for [dd], d=digit

Post by sydcarten »

I want to find and delete all double digits inside square brackets. for example: [21][32][43][54][65][76][87]
I thought a wildcard search something like [??] would work, but it doesn't.
does anyone know how to do it?
Last edited by MrProgrammer on Fri Jun 21, 2024 3:42 pm, edited 1 time in total.
Reason: Edited topic's subject
Apache Open Office 4.0.1
Windows 7
User avatar
robleyd
Moderator
Posts: 5509
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: wildcard search for single digits

Post by robleyd »

You probably need a regular expression; is this for use in Calc, Writer or what?
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
sydcarten
Posts: 12
Joined: Fri Aug 28, 2015 1:59 am

Re: wildcard search for single digits

Post by sydcarten »

the openoffice word document application.
I am copying and editing texts from Wikipedia.
Apache Open Office 4.0.1
Windows 7
User avatar
robleyd
Moderator
Posts: 5509
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: wildcard search for single digits

Post by robleyd »

In the Search for box use

Code: Select all

\[[:digit:][:digit:]\]
Your question says "find and delete all double digits inside square brackets'. It isn't clear if you want to delete just the digits and leave the brackets, or delete digits and brackets.

To delete just the digits, put [] in the Replace with field; to delete digits and brackets, leave it empty. Make sure you open the More Options and check the Regular Expressions box.
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
sydcarten
Posts: 12
Joined: Fri Aug 28, 2015 1:59 am

Re: wildcard search for single digits

Post by sydcarten »

I want to delete the digits and the brackets - but I don't want to delete square brackets that contain text, only those with double digits in them
Apache Open Office 4.0.1
Windows 7
sydcarten
Posts: 12
Joined: Fri Aug 28, 2015 1:59 am

Re: wildcard search for single digits

Post by sydcarten »

also, your solution doesn't work. when I put [] in the search for field it doesn't find anything
Apache Open Office 4.0.1
Windows 7
User avatar
RoryOF
Moderator
Posts: 35210
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: wildcard search for single digits

Post by RoryOF »

When you put [] in the search field after a search using Regular Expressions, you may need to select More Options and Uncheck Regular Expressions.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
User avatar
robleyd
Moderator
Posts: 5509
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: wildcard search for single digits

Post by robleyd »

Well, my answer will do what you want. The search expression I wrote above searches for left square bracket, followed by exactly two digits, followed by right square bracket. If you leave Replace with empty, you'll get what you want.

Read more about Regular Expressions from this web search or serach regular expressions in the offline HELP - F1.
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Post Reply