Is there a code in MS Word’s Find and Replace dialogue for “p(no.)(no.). “, where (no.) is any digit from 0-9? I’d like to replace that with “^l(no.)(no.). “
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Find/Replace
Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Find/Replace
- This topic has 5 replies, 3 voices, and was last updated 14 years, 5 months ago.
Viewing 4 reply threadsAuthorReplies-
WSjscher2000
AskWoody LoungerOctober 11, 2010 at 1:42 pm #1249030Is there a code in MS Word’s Find and Replace dialogue for “p(no.)(no.). “, where (no.) is any digit from 0-9? I’d like to replace that with “^l(no.)(no.). “
I’m going to assume that first p is a paragraph break. Please edit my code if that is not the case.
It’s easy to do the find part using
Code:Find what: ^p^#^#.
But replacing is more tricky. In order to replace a portion of the found text and preserve the rest, you need to enable wildcards. But then ^p and ^# are no longer legal in the find what string. So that requires you to use a different syntax that is closely similar in effect but not identical (^13 picks up UNIX-style line breaks as well as Windows style line breaks):
Code:Find what: ^13([0-9]{2}.) Replace with: ^l1
Note: the 1 copies the text match from the first parenthetical in the find what expression.
Edit: to match and replace a trailing space, add that after the period.
-
WSjmt356
AskWoody LoungerOctober 14, 2010 at 2:09 am #1249730I have a document with the Arabic word for “article” followed by an article number appearing over two hunderd times. I want to put a hard paragraph mark (enter; line break; ^p) between the article, the article number, and the text of teh article that follows so that the text of the article that follows will be below the word “article” and the corresponding article number.
I enabled wildcards adn used this code:
Find: {(2)} المادة
Replace: 1^pWhen I attempt a search, I get this message: “The Find What text contains a Pattern Match expression which is not valid.”
What’s not valid about it? And anyway, what does {(2)} mean? Whenever I search for that, I get any single character or space, regardign of whether there is a 2 in the parentheses or any other number, including 10.
-
macropod
AskWoody_MVPOctober 14, 2010 at 4:50 am #1249739Hi jmt,
What’s the actual string preceding the ‘المادة’ that you’re searching for? Your find code certainly won’t work as a wildcard Find expression – the {(2)} isn’t a valid expression. Assuming you’re looking for ‘(#) المادة’, where the # is a 1-3 digit number, try using:
Find = ‘(([0-9]{1,3}) )?????? ‘
Replace = ‘1’
(without the single quotes)Cheers,
Paul Edstein
[Fmr MS MVP - Word] -
WSjmt356
AskWoody LoungerOctober 17, 2010 at 3:45 am #1250430I am now trying to take every reference in my document to “(no.) المادة”, where (no.) is any number from 1 – 999, and replace it with “^p(no.) المادة”, such that before the number (after the number if you’re thinking linearly right to left as in Arabic) there will be a hard line break.
I was going to first go after the two digit numbers and then focus on the three digit numbers and then the one digit numbers. So focusing on the two digit numbers, I tried:
Find: ({2}[0-9]) المادة
Replace with: 1^pHowever, Word was replacing the selection with just the number followed by a hard enter instead of the word المادة followed by the number followed by a hard enter. Is Word unable to replicate the Arabic word using wildcards?
Also, macropod, for some reason, I’m still getting a message that the search item I’m looking for was not found when I search for (([0-9]{1,3}) )??????
I’m just going to attach the document. Please note that I already inserted hard paragraph breaks (^p) into the first few articles, but around article 26 (المادة 26) there is no hard paragraph break after the article number. If anyone could figure out the exact code that would work, it would be great, especially if it is a single code that coudl be used for one, two, or three digit numbers.
-
macropod
AskWoody_MVPOctober 17, 2010 at 4:25 am #1250438Hi jmt,
I’m not surprised the Find didn’t work, since the numbers aren’t enclosed in parentheses, which is what my Find code was based on. As I said:
Assuming you’re looking for ‘(#) المادة’ …
. Your post was quite ambiguous as to what you were looking for.
For your purposes, you should be able to use a wildcard Find/Replace, with:
Find = (المادة )([0-9]{1,3})
Replace = 21^pFinally, I see you’ve been posting on the same topic at: http://www.eileenslounge.com/viewtopic.php?f=26&t=3910
For cross-posting etiquette, please see: http://www.excelguru.ca/node/7Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Viewing 4 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Photos from iPhone to Win 10 duplicating/reformatting to .mov
by
J9438
6 minutes ago -
Thunderbird in trouble. Here comes Thundermail
by
Alex5723
1 hour, 59 minutes ago -
Get back ” Open With” in context menus
by
CWBillow
2 hours, 24 minutes ago -
Many AMD Ryzen 9800X3D on ASRock have died
by
Alex5723
6 hours, 11 minutes ago -
simple general stupid question
by
WSaltamirano
11 minutes ago -
Automatic Toggle code for pages and bookmarks for Table of Content (Awaiting moderation)
by
switchtolinux
10 hours, 33 minutes ago -
April 2025 Office non-Security updates
by
PKCano
2 hours, 17 minutes ago -
Microsoft wants to hear from you
by
Will Fastie
18 hours, 25 minutes ago -
Windows 11 Insider Preview Build 22635.5160 (23H2) released to BETA
by
joep517
20 hours, 46 minutes ago -
Europe Seeks Alternatives to U.S. Cloud Providers
by
Alex5723
1 day, 2 hours ago -
Test post
by
Susan Bradley
1 day, 4 hours ago -
Used Systems to delete Temp files Gone WRONG what does this mean?
by
Deo
1 day, 6 hours ago -
SSD shuts down on its own
by
CWBillow
21 hours, 36 minutes ago -
OneDrive File Sharing Changes
by
David Clark
1 day, 14 hours ago -
OneDrive File Sharing Changes
by
David Clark
1 day, 16 hours ago -
Win 10 Pro 22H2 to Win 11 Pro 23H2 Conversion Guide
by
doneager
16 hours, 23 minutes ago -
Today is world backup day
by
Alex5723
1 day, 7 hours ago -
Windows .exe on Mint
by
Slowpoke47
1 day, 17 hours ago -
Reviewing your licensing options
by
Susan Bradley
1 day, 3 hours ago -
Apple has been analyzing your photos since September 2024
by
B. Livingston
13 hours, 9 minutes ago -
What Windows 11 24H2 offers beyond bugs
by
Lance Whitney
9 hours ago -
Making sense of Settings in Windows 11
by
Simon Bisson
10 hours, 20 minutes ago -
Windows 11 pro fails to log in after upgrading Win 10 pro to Win 11 pro 24h2
by
ben_sitaud
1 day, 14 hours ago -
23H2 / 24H2 / Local v. Microsoft Account.
by
CWBillow
1 day, 11 hours ago -
YouTube Ad Blocker Blocker
by
bbearren
1 day, 12 hours ago -
Obscure historical facts about Windows
by
Cybertooth
1 day, 13 hours ago -
Microsoft Backup
by
Linda2019
1 day, 5 hours ago -
What is the best notepad++ version for W7?
by
Picky
1 day, 12 hours ago -
What are right steps to move MS 365 Office+OneDrive files from PC to iMac?
by
glnz
2 days, 22 hours ago -
How to move existing MS 365 Office with OneDrive files from PC to new iMac
by
glnz
2 days, 22 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.