Solved

Remove LF from html text

Posted on 2014-02-22
5
411 Views
Last Modified: 2014-02-22
I have several lines of text in html files that need to be removed.  Here is some sample text. I don't want to remove the LF's that are after an html tag

My regex is Javascript (MSIE Standard)

<h1>Love Is Blind But Collectors Aren't!</h1><br />LF
The Dollar Stretcher LF
by Gary ForemanLF
<p>Dear Dollar Stretcher,<br />LF
<b>I am getting married next year and have a question concerning our individualLF
credit histories. I have good credit and my Fiance does not. I have worked hardLF
to maintain a good credit rating, paying more than the minimum amount due eachLF
month. My Fiance however is not good at paying his bills and unfortunately hisLF
credit is suffering because of it. I basically have to remind him what's due,LF
how much, etc. If we get married will whatever he has owed previously (beforeLF
me) affect my credit or not? I don't want responsibility for something I hadLF
no involvement in. I understand that whatever we do together after we are marriedLF
is &quot;ours&quot; but what LF
about before? Can you please tell me what is right?</b> Amber<br />LF

Open in new window


this is what I am using and replacing with a blank string
[^>](\n)

but my regex is taking the preceding letter with the LF.  Please help me to get only the LF code and leave the preceding letter.

Thanks,

Randal
0
Comment
Question by:sharingsunshine
  • 3
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Dan Craciun
Comment Utility
Try this:
find: (\w|\s|,|\.|;)\n
replace: $1

Open in new window


HTH,
Dan
0
 

Author Comment

by:sharingsunshine
Comment Utility
thanks that is real close in fixing the problem.

I had truncated the amount of the sample text for brevity sake but now running the regex I see it is putting words together that weren't together initially.

Here is after the regex
<h1>Love Is Blind But Collectors Aren't!</h1><br />
The Dollar Stretcher by Gary Foreman<p>Dear Dollar Stretcher,<br />
<b>I am getting married next year and have a question concerning our individualcredit histories. I have good credit and my Fiance does not. I have worked hardto maintain a good credit rating, paying more than the minimum amount due eachmonth. My Fiance however is not good at paying his bills and unfortunately hiscredit is suffering because of it. I basically have to remind him what's due,how much, etc. If we get married will whatever he has owed previously (beforeme) affect my credit or not? I don't want responsibility for something I hadno involvement in. I understand that whatever we do together after we are marriedis &quot;ours&quot; but what about before? Can you please tell me what is right?</b> Amber<br />
<br />
Amber's right that just by getting married you do not assume the credit history of your spouse. His bad record will not automatically contaminate your good one. Your credit rating is only affected by what you do. Anything that you do yourself or jointly with someone else will be reflected on your record.<br />
<br />
But Amber is also correct that events after the marriage will effect both of their credit files. And as time goes by their credit histories will begin to look similar.<br />
<br />
Much as we'd like to, you can't marry just part of someone. We marry all of them. That includes their good and bad points. Also their assets and liabilities.<br />
<br />
Unless Amber keeps all of her financial affairs completely separate it will be almost impossible to avoid the influence of his debts. For instance, he may have agreed to pay half of the rent. But he could end up in a position where he's legally required to pay back a debt before he honors his commitment to Amber.<br />
<br />
Before the wedding I'd recommend putting together a joint budget. Just filling out a budget form together should be a real learning experience. Take plenty of time to discuss how each of you relate to money. Come to an agreement as to what's acceptable money behavior. Any couple planning marriage should do the same thing.<br />
<br />
Remember that it's very difficult to avoid getting tangled up in your spouse's problems. Whether your mate snores or has a financial troubles, it's pretty tough to ignore. And it will affect your relationship and home life.<br />
<br />
Amber's fiance isn't just bringing debts with him to the alter. He's also bringingpromises to make future payments to different creditors. It's just like Amberis also saying &quot;I do&quot; to his payment schedule. The marriage doesn'trelease him from any commitments to repay debt.<br />
<br />
The creditors won't attend Amber's wedding reception but they will expect to be repaid. So if he falls behind they'll go after any money that legally belongs to Amber's fiance. That includes anything that's owned jointly with her.<br />
<br />
There are several types of joint ownership. Space doesn't allow for a detailed discussion. But be careful. Many joint accounts (for instance a joint checking account) allow for either person to access all of the money. That means that all of the money is also available to creditors.<br />
<br />
Amber's husband-to-be may not want to tap into a joint account. But if he falls behind his creditors could get a judgement and force him to. Courts generally don't care who contributed to the joint account. If he can legally access the money it's also fair game for creditors.<br />
<br />
Keeping Amber's finances separate isn't going to be easy. Want to buy a home? You'll need to plan on doing it in your name alone. Joint ownership would make the house a target for creditors. Even if Amber supplied every single dollar that went into the house.<br />
<br />
This isn't going to be popular advice, but I'd suggest that Amber postpone the marriage until her fiance has better control of his debts. If the relationship is really important to him, he'll gladly make the sacrifice. If he's reluctant you need to know before the wedding.<br />
<br />
Anyone who's been married for awhile will tell you that you won't change your spouse's habits after the wedding. Don't expect him to adjust his ways later. If anything, tendencies become more ingrained.<br />
<br />
I don't mean to dump on somebody that Amber holds dear, but it's irresponsible to neglect to pay bills on time. Grown-ups don't do that type of thing. It could be symptomatic of an immature outlook on life.<br />
<br />
Starting a marriage with this type of handicap is a real challenge. Rememberthat today's &quot;reminder&quot; will become tomorrow's &quot;nagging&quot;. My guess is that if he ever starts getting calls from collection agencies he's not going to be very receptive to Amber's &quot;reminders&quot;.<br />
<br />
Hopefully Amber and her fiance will be able to set a solid foundation for a happy life together.<br />
_________<br />
<br />
Gary Foreman is a former purchasing manager who currently edits <a href="http://www.stretcher.com/save.htm" target="_blank">TheDollar Stretcher</a> website</a> <br />
You'll find hundreds of free articles to help you save time and money. Visittoday!<br />
</p>

Open in new window


individual and credit are put together and they were in the original sample.
bringing and promises are put together
Remember and that are put together and there are more.
0
 
LVL 34

Expert Comment

by:Dan Craciun
Comment Utility
OK, then just replace with $1{space}

I mean type $1 and then press on the space bar.
0
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 500 total points
Comment Utility
find: (\w|\s|,|\.|;|:)\n
replace: $1 

Open in new window

0
 

Author Closing Comment

by:sharingsunshine
Comment Utility
thanks that's a great help!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Whatever be the reason, if you are working on web development side,  you will need day-today validation codes like email validation, date validation , IP address validation, phone validation on any of the edit page or say at the time of registration…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now