![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 | |
|
Programmer
Join Date: Feb 2006
Posts: 40
Rep Power: 0
![]() |
preg_replace
I have to write a preg_replace function that must append the second line to the first line if the leading character of the second line is not 0,1,2 or 3.
Quote:
So it must append the second line to the first line. How can I write that preg_replace function?? |
|
|
|
|
|
|
#2 |
|
Programmer
Join Date: Aug 2005
Location: Leeds - UK
Posts: 69
Rep Power: 4
![]() |
don't know how....but your website sounds cool!
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Feb 2006
Posts: 40
Rep Power: 0
![]() |
I am parsing log files about 70000lines.And it is not a CSV file.Can u imagine how hard it is?? and then inserting into a database.And then another script for everykind of search.it was the hardest part because forming dynamic queries is really hard...
|
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
While the site sounds like lots and lots of fun, I suggest you edit the content next time.
![]() Hmmm... [php]preg_replace("/(.*)\r?\n([^0123].*)/", '\1\2', $myString);[/php] That should do it. Maybe - it's been a while since I played with these. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|