I have a string that I need to split into a specific character. However, I only need to split the string into one of these characters when it is surrounded by numbers. The same character exists elsewhere in the string, but will be surrounded by a letter - at least on one side. I tried using the split function as follows (using "x" as the character in question):
my @array = split /\dx\d/, $string;
This function, however, removes the "x" and flanking digits. I would like to keep the numbers, if possible. Any ideas?
source share