473,397 Members | 1,949 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,397 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 1144
"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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.