hankknight
asked on
ASP.NET/VB/REGEX: Two New Lines or Carriage Returns in a Row
I use this REGEX to identify two lines in a row:
The problem is that if the data was input using some operating systems that REGEX does not work.
How can I identify two new lines lines or carriage returns in a row regardless of the OS?
(\r\n\r\n)
I use it in this context:input = RegularExpressions.Regex.Replace(input, "(?=.{1,999}\n)([\S\S]*(?:(?: [!\S!\S]+)*)?)(\r\n\r\n)", "<strong class=""top"">$1 ...</strong>" + VbNewLine )
The problem is that if the data was input using some operating systems that REGEX does not work.
How can I identify two new lines lines or carriage returns in a row regardless of the OS?
Do you have an example of the output from the other OS?
ASKER
It does not apply the strong tag from the other OS.
What is the "other OS"? What is the input?
ASKER
My question is this:
(\r\n\r\n)
Instead of that, what can I do to detect two new lines in a row OR two Carriage Returns in a row?
(\r\n\r\n)
Instead of that, what can I do to detect two new lines in a row OR two Carriage Returns in a row?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
A question mark solves it.