473,800 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regex issues with quotation marks

I have this regular expression:

(?:(?<Value1>)? ?(?<Value2>(?:\ ([^\)]+\)|\[[^\]]+\]|\"[^\"].+\"))|(?
<Value1>.+))

It will capture these patterns fine

Value1
Value1 [Value2]
Value1 (Value2)
Value1 "Value2"

I need to modify the regular expression to also match these patterns:

"Value1"
"Value1" [Value2]
"Value1" (Value2)
"Value1" "Value2"

Please help.

Thanks
Jun 27 '08 #1
0 1030

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

Similar topics

8
3041
by: Stephen Poley | last post by:
One disadvantage of using a simple text editor to produce HTML is that it is relatively time-consuming to put in the proper typographical quotation marks and dashes. A round tuit having arrived on my desk, I've produced a couple of sed scripts to automatically convert the 'typewriter' equivalents: http://www.xs4all.nl/~sbpoley/webmatters/proper_quotes.html I've tested them fairly thoroughly, but I'd be grateful if a few other
63
5914
by: Tristan Miller | last post by:
Greetings. Do any popular browsers correctly support <q>, at least for Western languages? I've noticed that Mozilla uses the standard English double-quote character, ", regardless of the lang attribute of the HTML document. Will any browsers render German-style quotes or French-style guillemots for lang="de" and lang="fr", respectively? Regards, Tristan
5
2138
by: Gary McCullough | last post by:
What I want to do sounds simple, but it's defeating me. I want to substitute all occurences of a colon : character in a string with an @ character -- unless the : occurs within a single or double-quoted substring. Surely this can be done with regular expressions? Any regex gurus know how to do it?
7
11597
by: Paradigm | last post by:
I am trying to create a recordset where some text fields are matching. The problem is that some of the text fields contain quotation marks. I have tried to create the sql string using replace eg. "SELECT * FROM MYTABLE WHERE REPLACE(MYFIELD,"""",".") = """ & REPLACE(MYTEXT,"""",".") & """" but this does not work. Trying to replace the quotation marks with some other character in this case the stop How can I embed the quotation marks in...
3
3535
by: Ufit | last post by:
Simple,dumm question - how to include quotation marks in the string? F.ex. "Data Source=.\SQLEXPRESS;AttachDbFilename="C:\client data.mdf";Integrated Security=True;User Instance=True" I get syntax error. Thanks for help Ufi
9
342
by: proctor | last post by:
hello, i hope this is the correct place... i have an issue with some regex code i wonder if you have any insight: ================ import re, sys
31
4896
by: The Bicycling Guitarist | last post by:
Hi. For many years I have been using &quot; for double quotation marks in the HTML code, but the opening and closing quotation marks render the same in my browser. I'm considering going through and using &ldquo; and &rdquo; (in pairs as needed) instead. Are there any *disadvantages* to doing so, besides the time it will take to make the change? Thanks.
3
3670
by: Nightcrawler | last post by:
I am building a web page where people can link in a youtube video by copying and pasting the link that is provided by youtube. How can I use a regular expression to capture the URL only from the link below: <object width="425" height="355"><param name="movie" value="http:// www.youtube.com/v/xSqNx7vJLDE&rel=1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/ xSqNx7vJLDE&rel=1"...
3
1585
by: Jonathan Lukens | last post by:
I am in the last phase of building a Django app based on something I wrote in Java a while back. Right now I am stuck on how to return the matches of a regular expression as a list *at all*, and in particular given that the regex has a number of groupings. The only method I've seen that returns a list is .findall(string), but then I get back the groups as tuples, which is sort of a problem. Thank you, Jonathan
0
1175
by: Wilson799799 | last post by:
Hello, I am searching for a way to match quotation marks (extended ascii characters 147 and 148) with a .net regex. I tried this regex += .... |" + System.Convert.ToChar(147) + "|" + System.Convert.ToChar(148) + |\w+|)" but the convert yields an empty string. I cannot use the dot operator for this regex. Thank you.
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10504
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10274
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7576
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.