Learning that regular expressions is often about focussing on key trees in
the forest.
This is a great way to learn. Thanks all.
--
This is the BBEdit Talk public discussion group. If you have a feature request
or need technical support, please email "supp...@barebones.com" rather than
Much prettier & easier to read sirWell played.
On Monday, December 13, 2021 at 2:19:51 PM UTC-5 listmei...@gmail.com wrote:
> On Dec 12, 2021, at 23:38, Tim A wrote:
>
> Deepening the challenge, the phone numbers are actually in the second of
> three columns separated by tabs. If I can get
> On Dec 12, 2021, at 23:38, Tim A wrote:
> Deepening the challenge, the phone numbers are actually in the second of
> three columns separated by tabs. If I can get the phone numbers stripped I
> can then impose a uniform format on them.
Hey Tim,
Find:
[(]?(\d{3})\D*(\d{3})\D*(\d{4})
On Monday, December 13, 2021 at 6:36:13 AM UTC-8 ThePorgie wrote:
> Pulling your text and replacing the spaces in the tab areas and then
> Running the following
> (?:[- (\.\d]+)?(\d{3})(?:[- )\.]+)?(\d{3})(?:[- )\.]+)?(\d{4})
> with a replacement of
> \1-\2-\3 Is that what your
"...replacing the spaces in the tab areas..." Should of added "to simulate
the text you describe."
On Monday, December 13, 2021 at 9:36:13 AM UTC-5 ThePorgie wrote:
> Pulling your text and replacing the spaces in the tab areas and then
> Running the following
> (?:[- (\.\d]+)?(\d{3})(?:[-
Pulling your text and replacing the spaces in the tab areas and then
Running the following
(?:[- (\.\d]+)?(\d{3})(?:[- )\.]+)?(\d{3})(?:[- )\.]+)?(\d{4})
with a replacement of
\1-\2-\3
yields the following
Name1123-456-7890Single Lifetime
Name2123-456-7890Joint
*Try using a negative character class like [^\d\n\r] *
That will do it! .. and as an extra benefit catches any periods used as a
delimiter as well.
Deepening the challenge, the phone numbers are actually in the second of
three columns separated by tabs. If I can get the phone numbers stripped I
Hi Tim,
Try using a negative character class like [^\d\n\r] instead of \D.
HTH
Jean Jourdain
On Sunday, December 12, 2021 at 6:21:10 PM UTC+1 Tim A wrote:
> Simple task to strip out all non-digits in telephone numbers. \D works but
> also matches newline at the end of every line. Is there a
Simple task to strip out all non-digits in telephone numbers. \D works but
also matches newline at the end of every line. Is there a way to 'turn off'
the newline match?
I can do a
Find: [-() ] which will match the usual possible non-digit characters
which I can replace with nothing, but