I have a list of strings of the form
list={str1,str2,strx,str3,...,str10}
each string contains both letters and numbers, except for strx which does not contain numbers, what I want to do is attach strx to the element that immediately precedes it:
{str1,{str2,strx},...,str10}
I am using
lines /. {bef___, PatternSequence[x_, m_] /;
StringFreeQ[m, DigitCharacter], aft___} :> {bef, {x, m}, aft}
However this seems to match only the first occurrence of the pattern. How can I make it match several cases? I also want to be able to process a list that does not contain any of the strx.