... so as to force the OP to show effort.
And if you'd kept that to yourself, we might have found out if the OP had tried it.
With following the error messages and just a little effort, what I posted can become:
#! perl -slw
use strict;
for( qw[
ab123
'ab123s
'ab123's
] ) {
if(
m[
^'? [a-z] ## start with letter or an apostro
+phy followed by one
[a-z0-9'-_]+ ## Alphanumeric + '-_
(?: [a-z0-9] | s') $ ## ends with alphanumeric or s'
]x
and not
m[''|--] ## No doubled ''s or --s
){
print "$_: Ok!";
} else {
print "$_: Bad!";
}
}
__END__
C:\test>junk
ab123: Ok!
'ab123s: Ok!
'ab123's: Ok!
Which gives a starting point but not the whole thing.
If you're going to bother saying something, best make it something useful.
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.
In the absence of evidence, opinion is indistinguishable from prejudice.
Suck that fhit
| [reply] [d/l] |
LOL you are so Trumpian with the truth sometimes. You now claim that you *deliberately* posted broken code? Ha-ha.
"If you're going to bother saying something, best make it something useful."
Oh, but I did. It was useful in pointing out that you offered a complete solution to a question that showed no effort, but also posted non-compiling code (although that didn't stop the sheep upvoting blindly as they always do); as well as in pointing out your utter lack of humility and ability to admit a mistake.
The way forward always starts with a minimal test.
| [reply] |
You now claim that you *deliberately* posted broken code?
No. You're trying to put words in my mouth as usual.
The code I posted was typed straight into the edit field and never tested. It's purpose was to give the OP an approach to solving his problem -- by turning his wordy, belaboured, prose description into more concise & clearer code -- not to solve it for him.
It probably took me no more time or effort to type; than it took you to type your earn-a-few-more-xp-points-for-no-effort-totally-negative-knee-jerk response to the OP. And whilst I knew full well it might not fully encapsulate his requirements, and might well not compile, how he reacted to it could have told us so much about both his requirements and his skill level.
So little effort in fact that even if it had compiled clean, and completely solved the OPs problem by cut&paste, I would not have begrudged him that. Why do you? Why do you so begrudge a stranger the benefit of someone else's time and effort? Nobody is asking, much less requiring you to be a "code writing service"; but why do you feel the need and right to speak on behalf of others here?
Of course, chances are he never even saw it, because your totally unhelpful, totally negative, must-be-first response, probably caused him to go away and never come back.
So, well done on driving away yet another potential contributor with your first-off-the-blocks, grudging negativity. Way to go.
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.
In the absence of evidence, opinion is indistinguishable from prejudice.
Suck that fhit
| [reply] |