in reply to removing characters using regex
Let's say you are surgeon, and you have some 'human being', which has 'appendix', like this:
$h='human be/appendix ing'If you want to cut it out, you do it like this:
$h =~ s#/appendix ##;That was the case with you as a perfect surgeon - no scars left. But in real world, real code, leaving scars, would be:
$h =~ s#/appendix #~#;Human being has many more things to cut out, of course: kidneys, tonsils, liver:
$h = 'h/tonsils uman /first_kidney /second_kidney b/liver e/appendix ing'And if you were crazy enough and willing to perform encores, you would do:
$h =~ s#/\w+ #~#gIt's soooo good, that surgeons have no //g flag implemented...
|
|---|