Re: [NTB] Finding a number followed by a paragraph mark
- At 25/09/2008 10:35 AM, Don - HtmlFixIt.com wrote:
>Robin Chapple wrote:So this is my first venture with regex. I have read the help page on
> > I am a beginner at using these 'expressions'.
> > I need to insert a tab after every telephone number that is followed
> > by a paragraph mark.
> > I propose to use the 'Replace' command.
> > In Help I found that
> > \d =ny decimal digit
> > Which I hoped would find the last number in a telephone number by using"
> > Find: \d^P
> > but nothing is found.
> > What should I be doing?
> > Many thanks,
> > Robin Chapple
>You got it but ^P becomes \r\n in regex.
>So it's this:
regular expressions and I am out of my depth.
The expression \d\r\n does find the paragraph mark, but the replace
command takes the decimal digit as well.
How do I just replace the ^P with ^T if it follows a decimal digit?
- The tab part of this ^T or \t depending on regular or regex that you
mention below is a new twist Robin. You didn't mention a tab before.
In your top dialog box put (\d)\r\n
By adding the parenthesis you have a found pattern that is assigned to a
variable sort of ...
then you can replace that variable (the number) back in by putting this
in the bottom box in the dialog:
the $1 refers to the thing contained in the () above. If you had more
than one thing in parenthesis in that top find pattern then you would
have $1, $2, etc to put them back in if you want.
I by the way assume you are on the latest copy of notetab as regex has
improved a lot the past year or so.
> So this is my first venture with regex. I have read the help page on
> regular expressions and I am out of my depth.
> The expression \d\r\n does find the paragraph mark, but the replace
> command takes the decimal digit as well.
> How do I just replace the ^P with ^T if it follows a decimal digit?
> Many thanks,
> Robin Chapple