r054
02-22-2008, 11:46 AM
Hi,
I'm using find and replace to find a certain pattern in the document. Is it possible to have an optional character in find and replace? In normal regular expression ? (question mark ) is used to indicate if the character is optional. But I'm not sure how to do it in find and replace.
This is what I have:
.Text = ".,page .#[0-9a-z]{1,}^13"
The period in the beginning and before the # symbol are optional. It should find the sentence even if the period (.) symbols are not there.
I've tried this one but didn't work
.Text = "[.]{0,},page [.]{0,}#[0-9a-z]{1,}^13"
Any help would be appreciated.
I'm using find and replace to find a certain pattern in the document. Is it possible to have an optional character in find and replace? In normal regular expression ? (question mark ) is used to indicate if the character is optional. But I'm not sure how to do it in find and replace.
This is what I have:
.Text = ".,page .#[0-9a-z]{1,}^13"
The period in the beginning and before the # symbol are optional. It should find the sentence even if the period (.) symbols are not there.
I've tried this one but didn't work
.Text = "[.]{0,},page [.]{0,}#[0-9a-z]{1,}^13"
Any help would be appreciated.