On Monday 16 May 2005 22:53, Al wrote: > What pattern can I use to match ONLY single occurrences of a character in a > string. > > e.g., "Some text @ and some mo@@re and [EMAIL PROTECTED], etc @@@.
Use the following:
/(^@)(@{1})(^@)/
This way you'll be sure the regexp will match only single occurences ot hte
'@' symbol.
Please take in mind that if you have this symbol in the beginning of the
string or at the end - you have to modify this.
>
> I only want the two occurrences with a single occurrence of "@".
>
> @{1} doesn't work; there are 4 matches.
>
> Thanks....
--
Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)
PGP ID: 7AE45436
PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc
PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436
pgpWSAkSaWAeD.pgp
Description: PGP signature

