Page 1 of 1

Understanding the "any" character

Posted: Sat Jan 30, 2010 7:29 pm
by pieter1
I have a series of files which contain structures like:
<Z>...<a>...</a><b>...</b>...><c>...</c>...><d>...</d>...etc.</Z>
... stands for multiline content including other xml tags.

I need to replace in all files the the a and b content. I defined my search string as:
<a>[\.\n]{*}</b>
The \. is defined in the manual (version 7.6.3) as any character except newline, hence the collection of these two in the search.
Apparantly this was a naive assumption. What do I miss?

Re: Understanding the "any" character

Posted: Tue Feb 02, 2010 3:03 am
by pieter1
Do I understand correctly from the post: RE: Replace specific links with the underlying link text that the . (dot) and not the \. should be used as the any character?
My example still does not work if I remove the \ from the filter

Pieter Zanstra

Re: Understanding the "any" character

Posted: Wed Feb 03, 2010 7:34 am
by DataMystic Support
Hi Pieter,

Within a character class [], both . (normally a wildcard for any character) and \. , which stands for a period (full stop), both take the meaning of a full stop.

So [.] and [\.] both mean the same as '.'.

Outside of a character class, the meaning of '.' is controlled by the Matching Options dialog - the [...] button next to the Search Type.