Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 17th, 2007, 04:05 PM
Registered User
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Regular expression challenge - please help !


hello,

I need to create regular expression pattern that matches 2 differnt lines separated by new line in notepad, as follows:

merge point angle reached maximum
angle = 45

I tried to use \n in order to create this match, as follows:

"merge point angle reached maximum\nangle = 45"

however the match failed,

What is the correct way to create this match?

Thanks
eyalco


 
Old February 18th, 2007, 01:33 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Unix uses \n to terminate lines windows however uses \r\n (Carriage Return and Line Feed) to terminate lines. So i think you need to match both.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 18th, 2007, 06:13 AM
Registered User
 
Join Date: Feb 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default



Hi dparsons

Thank you very match :) :) (much)

I succeded to create this match thanks to you,
It's strange that in each regular expressions reference i looked, there was no comment about the a difference between unix and windows in this matter. I indeed use windows. \r\n works fine.

Thanks again
eyalco




Quote:
quote:Originally posted by dparsons
 Unix uses \n to terminate lines windows however uses \r\n (Carriage Return and Line Feed) to terminate lines. So i think you need to match both.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 18th, 2007, 10:11 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Your welcome Im glad it worked out for you.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429





Similar Threads
Thread Thread Starter Forum Replies Last Post
regular expression MunishBhatia ASP.NET 2.0 Professional 5 May 22nd, 2007 07:59 AM
Regular Expression in C++ praveenholal C++ Programming 1 March 4th, 2007 01:18 AM
Regular expression C# radhakrishnan1976 General .NET 1 February 19th, 2006 01:11 AM
regular expression if-then smay Javascript 4 July 5th, 2005 12:10 PM
Regular expression help!!! alex_read Javascript 4 August 18th, 2004 03:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.