As i am a newbie to regex and perl, hope you will help me solve this problem.
I also learn as i take the help.
I have a string like
for this i have regex
@ar=split('(?<=[KR](?!P))',$str); #to split where i ever i see a K or
Now what i want to do is,
1) I want to split the string during the second occurance of K or R. and not during his first occurence. In that case, in my array, each fragment will contain two K (or) R, one being somewhere in the string and other will be at the end of string ending with a K or R.
2) Likewise, i also want to split the string during the third occurance of K or R and not during the second occurance. In that case, my array will have fragments containing three K's or R's, two being somewhere in the string and the last one will be at the end of string ending with a K or R.
Please help me learn :)