473,386 Members | 1,621 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,386 software developers and data experts.

Regular Expressions ?

Hi,

I'm playing around with HTML pattern matching, and have a questions about
parsing more than one line of text. If I want to parse multiple lines of
text for a match, do I have to explicitly specify \n appearances in my
expression (meaning I would have to know how many lines I'm dealing with
ahead of time)? Seems like there's another way to do it. For example, say
I want to capture a string beginning with <tr> and ending with </tr> that
spans multiple lines in the HTML source. How do I tell it to include
newlines in the search without doing \n.*\n.* etc.

Thanks!
Brian
Nov 18 '05 #1
2 1259
Line Breaking characters (\r\n) are simply characters in a string. You see
line breaks when displaying the string in NotePad or another text editor,
because that is how they are supposed to look. Treat them as you would any
other character. And BTW, the \s character class will match any white space
character, including carriage returns and line feeds.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"anony" <no**@m.com> wrote in message
news:wm*********************@twister.tampabay.rr.c om...
Hi,

I'm playing around with HTML pattern matching, and have a questions about
parsing more than one line of text. If I want to parse multiple lines of
text for a match, do I have to explicitly specify \n appearances in my
expression (meaning I would have to know how many lines I'm dealing with
ahead of time)? Seems like there's another way to do it. For example, say I want to capture a string beginning with <tr> and ending with </tr> that
spans multiple lines in the HTML source. How do I tell it to include
newlines in the search without doing \n.*\n.* etc.

Thanks!
Brian

Nov 18 '05 #2
Line Breaking characters (\r\n) are simply characters in a string. You see
line breaks when displaying the string in NotePad or another text editor,
because that is how they are supposed to look. Treat them as you would any
other character. And BTW, the \s character class will match any white space
character, including carriage returns and line feeds.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"anony" <no**@m.com> wrote in message
news:wm*********************@twister.tampabay.rr.c om...
Hi,

I'm playing around with HTML pattern matching, and have a questions about
parsing more than one line of text. If I want to parse multiple lines of
text for a match, do I have to explicitly specify \n appearances in my
expression (meaning I would have to know how many lines I'm dealing with
ahead of time)? Seems like there's another way to do it. For example, say I want to capture a string beginning with <tr> and ending with </tr> that
spans multiple lines in the HTML source. How do I tell it to include
newlines in the search without doing \n.*\n.* etc.

Thanks!
Brian

Nov 18 '05 #3

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

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
2
by: Sehboo | last post by:
Hi, I have several regular expressions that I need to run against documents. Is it possible to combine several expressions in one expression in Regex object. So that it is faster, or will I...
1
by: Sehboo | last post by:
Hi, I have several regular expressions that I need to run against documents. Is it possible to combine several expressions in one expression in Regex object. So that it is faster, or will I...
4
by: Együd Csaba | last post by:
Hi All, I'd like to "compress" the following two filter expressions into one - assuming that it makes sense regarding query execution performance. .... where (adate LIKE "2004.01.10 __:30" or...
1
by: Allan Ebdrup | last post by:
I have a dynamic list of regular expressions, the expressions don't change very often but they can change. And I have a single string that I want to match the regular expressions against and find...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.