473,320 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Regular expression that doesn't recognize newline

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
po********@etantonio.it
Jul 21 '05 #1
1 1139
"Antonio" <et*******@libero.it> wrote in
news:ba**************************@posting.google.c om...
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:
style=padding:10px;>(?<Traduzione>[^<]*)</div></td>
also do?
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
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: tdl | last post by:
Hi everybody, I'm a regular expressions newbie; I read many tutorials, but need more experience before becoming indipendent in this field. I need a little help from you. How can I split such a...
2
by: Oriana | last post by:
Hi! I'm trying to 'clean up' this source file using regular expressions in Python. My problem is, that when I try to delete extra lines, my code fails. Here's an example.... /** * *...
3
by: Gianluca | last post by:
Hi, I'm using regular expressions to extract some information from my vb.net source code files. I have something like this: 1: '<class name="xyz" description="xxxxxx"/> 2: Class xyz ......
1
by: Antonio | last post by:
Good morning, I've the following part of an html file, //////////////////////////////////////////////////////////////////////// </font></b></td> </tr> <tr> <td bgcolor=white class=s><div...
3
by: Guoqi Zheng | last post by:
Dear sir, On regular expression, a . means Match anything except newline. How about if I need it to includes newline as well? I try , but it seems not working. and idea? -- Kind regards
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
3
by: Peter Afonin | last post by:
Hello, I'm looking for a simple regular expression for the Regular Expression validator that would allow any text, spaces and the line breaks and had a minimum and maximum text length. Something...
3
by: shapper | last post by:
Hello, I have a regular expression to validate email addresses: "\w+(\w+)*@\w+(\w+)*\.\w+(\w+)*" Now I need to force all emails to be from a given domain, for example, accept only:...
12
by: chaarmann | last post by:
I want to format a long line of text by inserting newline-characters in a way that the printout contains small rows with maximum 80 chars. But I am not allowed to split inside the sequence "<(>"....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.