Wildcards and ARabic text

jmt356
SilverLounger
Posts: 2389
Joined: 28 Mar 2010, 01:49

Wildcards and ARabic text

Post by jmt356 »

I 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 the 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 and used this code in Find/Replace:
Find: {(2)} المادة
Replace: \1^p

When 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.
Regards,

JMT

User avatar
HansV
Administrator
Posts: 78447
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Wildcards and ARabic text

Post by HansV »

Sorry, I'm probably missing something, but if you don't know what {(2)} does, why did you put it in the Find What box?
Best wishes,
Hans

jmt356
SilverLounger
Posts: 2389
Joined: 28 Mar 2010, 01:49

Re: Wildcards and ARabic text

Post by jmt356 »

I posted on Woody's Lounge a related topic (I was trying to use wildcards for any number having two digits) and was given that code from a poster.
Regards,

JMT

User avatar
HansV
Administrator
Posts: 78447
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Wildcards and ARabic text

Post by HansV »

Try this:

Find what: " ([0-9]{1,} المادة)" without the quotes - the quotes are used to indicate that there is a space before ([0-9]. When I paste this into the box, it is reversed.
Replace with: \1^p
x356.png
[0-9] means any digit.
{1,} means 1 or more of the previous - in this example 1 or more digits.
The entire expression within the parentheses ( ) is referred to in the Replace with box as \1.
^p in the Replace with box is the end-of-paragraph marker.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans