473,505 Members | 15,036 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extracting strings from stream using Regex

Is it possible to do this extraction in Java from the InputStream?

<sql commands="select title from books" sql>
other patterns
....
....

The result will be just:
select title from books

that is extracting the fields ONLY between <sql ... sql> and between " "

Thank you for the response
Jul 17 '05 #1
2 6109
On Fri, 05 Sep 2003 16:20:24 GMT, "hantie" <ha****@hotmail.com> wrote
or quoted :
Is it possible to do this extraction in Java from the InputStream?

<sql commands="select title from books" sql>


There examples very similar to that at
http://mindprod.com/jgloss/regex.html

Make sure you read the difference between matching and finding.
You want to find, then possibly later match to extract the essence.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Jul 17 '05 #2

"Roedy Green" <ro***@mindprod.com> wrote in message
news:4a********************************@4ax.com...
On Fri, 05 Sep 2003 16:20:24 GMT, "hantie" <ha****@hotmail.com> wrote
or quoted :
Is it possible to do this extraction in Java from the InputStream?

<sql commands="select title from books" sql>


There examples very similar to that at
http://mindprod.com/jgloss/regex.html

Make sure you read the difference between matching and finding.
You want to find, then possibly later match to extract the essence.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Thank you Roedy
Jul 17 '05 #3

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

Similar topics

6
4775
by: Dave | last post by:
I'm struggling with something that should be fairly simple. I just don't know the regext syntax very well, unfortunately. I'd like to parse words out of what is basically a boolean search...
5
4161
by: Jensen bredal | last post by:
Hello, I have a string formated in the following way: s = 1;32;100;32;09;.........;09;76; I need to extract the numbers separated by the seicolon. The list can contain several thousands of...
0
1190
by: Bubbles | last post by:
Hello. New to ASP.NET and struggling on this one. I have a text file with a bunch of text in it. Throughout the file words followed by a ":" will appear. I need to pull every such string out...
5
1640
by: Terry Olsen | last post by:
Is there a good way to find a pattern of bytes/chars in a stream? I've got a serial port connected to a tcp port. I need to be able to catch a unique character string in the stream so that I can...
1
1517
by: John Seeliger | last post by:
I am pretty new to VB, so please forgive the simplistic question. This is using VB .NET Standard 2003. My form has three objects on it: a TextBox named URL, a Button named Extract and a...
13
3717
by: Randy | last post by:
Is there any way to do this? I've tried tellg() followed by seekg(), inserting the stream buffer to an ostringstream (ala os << is.rdbuf()), read(), and having no luck. The problem is, all of...
8
2569
by: Bob | last post by:
I need to create a Regex to extract all strings (including quotations) from a C# or C++ source file. After being unsuccessful myself, I found this sample on the internet: ...
5
3216
by: Denis Petronenko | last post by:
Hello, how can i read into strings from ifstream? file contains values in following format: value11; val ue12; value 13; valu e21;value22; value23; etc. i need to read like file >string,...
3
1906
by: | last post by:
I'm analyzing large strings and finding matches using the Regex class. I want to find the context those matches are found in and to display excerpts of that context, just as a search engine might....
0
7216
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
7303
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
7367
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
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5613
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
4699
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...
0
3187
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...
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.