Although regexes seem to be a recurrent trouble, I didn't figure out a solution to my problem.I have a file of many lines (> 75 000), in which I want to replace a lot of them, all between two identifiable patterns (starting_point and ending_point). My regex attempt :\[code\]$filtered = preg_replace('%(#\sstarting_point).+(#\sending_point)%isU',$replacement,$2befiltered);\[/code\]. is now whatever character, including \n. I used %..% as separators because my lines have pretty much anything, but no % (anything includes /,$,-,",spaces,+,{,}) and I was experiencing a "Compilation failed: nothing to repeat at offset...".But I can't seem to make it work. I thought maybe pcre in php.ini was the problem, but it doesn't seem so. I tried to use ?U, without success. same with .*? as I have read in some places. Maybe I just wrote them wrong, but ..Anyway, anybody willing to scratch his head on this?text example (with ... signifying many other lines):\[code\]whateverlinesyoucan...# starting_pointlines/*-to$_,"delete+{}=@...# ending_pointsomeotherlines...\[/code\]