On 2011-01-18, andrew1 <andrew1@mytrashmail.com> wrote:
> hi all,
>
> these return t:
> select 'ab' ~ '[a-z]$'
this matches the b and the end of the string
> select 'ab' ~ '^[a-z]'
this matches the start of the string and the a
> select 'ab' ~ '^[a-z]$' returns f
> Can't I use ^ and $ at the same time to match, in this case?
> thanks.
the above expression only succeeds if the string is one character long
use '+' '*' or '{2}' etc after the '[a-z]' to allow it to match several letters
or use '^[a-z]|[a-z]$' to match any sting that starts or ends with a
letter.
what are you trying to find?
--
⚂⚃ 100% natural