preg replace woes |
||
![]() ![]() Alpha Lt Cyben Hi Well I'm fairly new to regexp - and *gasp* have never used perl. I am, on the other hand, trying to write something in php that will get rid of newlines IF they're inside quotes. Here's the background: What I've got to work with is a huge excel file, exported as tab-delimited text. Sadly, many of the cells contain the newline character. However, if a cell contains this newline character, its contents are surrounded in doublequotes. I want to replace all of these newline chars with " -- ". So, I need to replace every instance of: ([tab] OR [newline])"sometext[newline](sometext[newline])*"([tab] OR [newline]) with ([tab] OR [newline])"sometext -- sometext (or as many as there are)"([tab] OR [newline]) Does anyone know the pattern/replacement for how to do this? And better yet (or preferably in addition), does anyone know where I can get a good tutorial on this? Regexp tends to looks like line-noise to me =\ -------------------------------- Lt Cyben
|
||
| CyberArmy::Forum v0.6 Generated In 0.00476 seconds |