in reply to Re: sorting difficulty
in thread sorting difficulty

hi, thanks for your reply. $str =~ s/(?<=<tag refid=")([^"]*)(?=")/sort_and_reformat($1)/eg; is not removing commas. also, 1 more doubt, some times i might need to sort alphabets too, e.g. <tag refid="c,b,a">

Replies are listed 'Best First'.
Re^3: sorting difficulty
by moritz (Cardinal) on May 07, 2008 at 10:26 UTC
    is not removing commas.

    Did you even try it? It works for me. If it really doesn't work for you: What version of perl are you using, and what's the result on your perl?

    If you want to sort both numbers and letters correctly, you should use Sort::Naturally (and replace sort with nsort).

      Thanks a lot, its working perfectly fine now. Thanks for your time and help.