473,383 Members | 2,005 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,383 software developers and data experts.

Help with Java & Regular Expression

Hello,
I have one line of Java and regular expression that I got from the web :
Expand|Select|Wrap|Line Numbers
  1. String[] opt;
  2. opt = line.split("\\s+(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
If "line" contains :
1 "Hello World"

this code would give me :
opt[0] : 1
opt[1] : "Hello World"


which is almost what I would like to do except for the double quotes. I wonder if someone could please help me change the regular expression so that it would return :
opt[0] : 1
opt[1] : Hello World


Thank you and Best Regards,

Akino
Jul 18 '11 #1
0 1005

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: YoBro | last post by:
Hi I have used some of this code from the PHP manual, but I am bloody hopeless with regular expressions. Was hoping somebody could offer a hand. The output of this will put the name of a form...
6
by: Danny | last post by:
I need an asp command to strip out from a string all extra punctuation such as apostrophe, comma, period, spaces dashes, etc etc and just leave the letters. Can anybody give me some ideas? ...
2
by: alexstevens | last post by:
Hi All. I'm using some C# code which I translated to vb.net to remove sourcesafe information from project and solution files. It uses regular expressions, and the attempt I made at translating...
3
by: madner | last post by:
Hi, does anyone know if exist any web site or service I can access with java to retrieve informations about nasdaq quotes? Thanks. madner
3
by: Mani Ram | last post by:
Hi Guys, I am new to C#. I have a xml string and I want to read a value of a particular element. I do not want to use dom for this purpose. I think Regular expression will solve this. the code...
3
by: David Hearn | last post by:
I am trying to use RegEx.Match to locate some text in an HTML file. I am trying to find everything between <map> files so that I can grab the coordinates. The map files looks like this: <map...
2
by: Luhar | last post by:
After much scouring of information on Regular Expressions from books and the web, I've come up with the this handy little Regex to parse links from HTML: ...
7
by: Joey | last post by:
Hello, I need a regular expression that will allow alpha-numeric characters, the underscore character, the period character, and the single quote character. The following is not working, for...
3
by: Mr.Steskal | last post by:
Posted: Wed Jul 11, 2007 7:01 am Post subject: Regular Expression Help -------------------------------------------------------------------------------- I need help writing a regular...
1
by: rporter | last post by:
I have a javascript utility and need so help with regular expressions.. Basically I have lines of data that consists of name=value pairs delimited with commas. example match=type...
1
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.