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.). “
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
-
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
1 hour, 25 minutes ago -
Creating an Index in Word 365
by
CWBillow
9 hours, 37 minutes ago -
Coming at Word 365 and Table of Contents
by
CWBillow
9 hours, 42 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
14 hours, 38 minutes ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
18 hours, 3 minutes ago -
W11 24H2 – Susan Bradley
by
G Pickerell
19 hours, 59 minutes ago -
7 tips to get the most out of Windows 11
by
Alex5723
18 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
11 hours, 22 minutes ago -
I installed Windows 11 24H2
by
Will Fastie
1 minute ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
23 hours, 26 minutes ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
6 hours, 28 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
1 day, 7 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
15 hours, 53 minutes ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
16 hours, 8 minutes ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
2 days ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
2 days, 9 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
1 day, 11 hours ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
1 day, 17 hours ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
2 days, 4 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
3 days, 20 hours ago -
50 years and counting
by
Susan Bradley
18 hours, 18 minutes ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
21 hours, 7 minutes ago -
Licensing and pricing updates for on-premises server products coming July 2025
by
Alex5723
4 days, 7 hours ago -
Edge : Deprecating window.external.getHostEnvironmentValue()
by
Alex5723
4 days, 7 hours ago -
Rethinking Extension Data Consent: Clarity, Consistency, and Control
by
Alex5723
4 days, 7 hours ago -
OneNote and MS Word 365
by
CWBillow
4 days, 9 hours ago -
Ultimate Mac Buyers Guide 2025: Which Mac is Right For You?
by
Alex5723
4 days, 9 hours ago -
Intel Unison support ends on Windows 11 in June
by
Alex5723
4 days, 9 hours ago -
April 2025 — still issues with AMD + 24H2
by
Kevin Jones
2 days ago -
Windows 11 Insider Preview build 26200.5518 released to DEV
by
joep517
4 days, 21 hours ago
Recent blog posts
Key Links
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.