This little example shows how to use a regex on different lines:
1 2 3 4 5 6 7 8 9 10 11 12 |
print reg("1n2n3n","2","-","n",2..3).$/; print reg("1,2,3,4,5,6",".+","-",",",2..3,5..6).$/; #sub sub reg { my ($strr,$reg1,$reg2,$split,@count) = @_; my @elem = split($split,$strr); for(@count){ $elem[$_-1] =~ s/$reg1/$reg2/g; } return join $split,@elem; } |
As Result we get this:
1 2 |
1n-n3 1,-,-,4,-,- |
I’ve been surfing on-line greater than 3 hours these days,
but I by no means found any attention-grabbing article like yours.
It’s lovely price sufficient for me. In my
view, if all web owners and bloggers made excellent
content as you did, the net shall be a lot more helpful
than ever before.
Hey there! This is my first visit to your blog!
We are a collection of volunteers and starting a new project
in a community in the same niche. Your blog provided us beneficial information to work on. You have done a extraordinary job!
I do agree with all of the concepts you have introduced on your post.
They are very convincing and will definitely work.
Nonetheless, the posts are too short for starters.
May you please lengthen them a little from next time?
Thank you for the post.