in reply to Regex to compare (if) two strings (Uniquely - I will explain inside)
Sort the letters in both strings and compare the results:
$randword = join'', ('A'..'Z')[ map rand 26, 1..8 ];; print $randword;; LDAZAJSA chomp( $input = <STDIN> );; AAADJLSZ print join('', sort split '', $randword ) eq join( '', sort split '', +$input ) ? 'Ok' : 'Bad';; Ok
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Regex to compare (if) two strings (Uniquely - I will explain inside)
by frozenwithjoy (Priest) on Nov 24, 2012 at 18:29 UTC | |
by BrowserUk (Patriarch) on Nov 24, 2012 at 20:02 UTC |
In Section
Seekers of Perl Wisdom