Regular expression that doesn't recognize newline

A

Antonio

Good morning,
I've the following part of an html file,

////////////////////////////////////////////////////////////////////////
</font></b></td>
</tr> <tr>
<td bgcolor=white class=s><div style=padding:10px;>Computer
science, Universit,
Economy, Finance</div></td>
</tr>
////////////////////////////////////////////////////////////////////////

I would want to extract the words "Computer science, Universit,
Economy, Finance" using the following regular expression:

style=padding:10px;>(?<Traduzione>(?:\w|\s|\.|\d|\:|\"|\,|\?|\'|\-)*)</div></td>

the problem is that it doesn't recognize the newline character after
Universit, so the result is no match but I can't understand why, can
you help me to solve the problem???

Many thanks,

Antonio D'Ottavio
www.etantonio.it/en
(e-mail address removed)
 
N

Niki Estner

Antonio said:
Good morning,
I've the following part of an html file,

////////////////////////////////////////////////////////////////////////
</font></b></td>
</tr> <tr>
<td bgcolor=white class=s><div style=padding:10px;>Computer
science, Universit,
Economy, Finance</div></td>
</tr>
////////////////////////////////////////////////////////////////////////

I would want to extract the words "Computer science, Universit,
Economy, Finance" using the following regular expression:

style=padding:10px;>(?<Traduzione>(?:\w|\s|\.|\d|\:|\"|\,|\?|\'|\-)*)</div></td>

Just curious: Why do you use such a complex list of alternatives? Wouldn't
something simple like:
the problem is that it doesn't recognize the newline character after
Universit, so the result is no match but I can't understand why, can
you help me to solve the problem???

I tested it, and it did match. Maybe there's another problem with your code?
What flags did you use to initialize the RegEx class? In your string, is
there a "\n" or a "\r\n"? (Just guessing)

Niki
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top