Hi Ram,

On Wed, 24 Aug 2011 20:24:00 +0530
Ramprasad Prasad <ramprasad...@gmail.com> wrote:

> Assume I have to find the first unique character in a string
> 

In that case, use a hash. Is there any reason you want to do it using a regex?

Regards,

        Shlomi Fish
 
> $string = "abtable";
> 
> # t is the first unique string
> 
> I tried using a negative backtrace lookup to get the answer in a
> single regex ... But something is missing.
> 
> /(.).(?!\1)/ && print $1;
> 
> it seems fine ... But doesn't work
> 



-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
The Case for File Swapping - http://shlom.in/file-swap

Knuth is not God! Typing “God” into Google and pressing “I’m Feeling Lucky”
will not lead you to his homepage.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to