// New line is required to split non-blank linespreg_replace("/(^[rn]*|[rn]+)[st]*[rn]+/", "n", $string);
上面的正则表达式说:
/(^[rn]*|[rn]+)[st]*[rn]+/ 1st Capturing group (^[rn]*|[rn]+) 1st Alternative: ^[rn]* ^ assert position at start of the string [rn]* match a single character present in the list below Quantifier: Between zero and unlimited times, as many times as possible, giving back as needed [greedy] r matches a carriage return (ASCII 13) n matches a fine-feed (newline) character (ASCII 10) 2nd Alternative: [rn]+ [rn]+ match a single character present in the list below Quantifier: Between one and unlimited times, as many times as possible, giving back as needed [greedy] r matches a carriage return (ASCII 13) n matches a fine-feed (newline) character (ASCII 10) [st]* match a single character present in the list below Quantifier: Between zero and unlimited times, as many times as possible, giving back as needed [greedy] s match any white space character [rntf ] tTab (ASCII 9) [rn]+ match a single character present in the list below Quantifier: Between one and unlimited times, as many times as possible, giving back as needed [greedy] r matches a carriage return (ASCII 13) n matches a fine-feed (newline) character (ASCII 10)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)