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

google like search syntax parsing (also posted in sql programming group)

this is more of a text parsing/regex kind of question, but i figured
i'd start here. please let me know if this should go somewhere else.

I'd like to implement google-like search syntax, a la
http://www.google.ca/help/refinesearch.html

so a text query like this:

("google search" "regular expressions") OR (syntax text)
aSpecificField:somevalue

[some intermediate object that holds the expressions]

and turns into an sql query like this:

([aSpecificField] LIKE '%somevalue%') AND
(([field1] LIKE '%google search%' AND [field1] LIKE '%regular
expression%') OR ([field1] LIKE '%syntax%' AND [field1] LIKE '%text%'))
OR (([field2...repeat for all fields

basically i am having trouble figuring out how to parse the text query
to keep track of brackets and double-quoted expressions. am more
interested in parsing the text than turning it into SQL.

anyone have a reference that shows this being done?

thanks in advance!

Nov 19 '05 #1
2 2135
hi stan

thanks for your reply. i'm looking more for info on parsing strings to
keep track of quoted and parenthesized values.

thanks

neil

Nov 19 '05 #2
Well, your original example had the phrase "Regular Expressions" in it, and
it sounds like you're on the right track there.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

<ne**********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
hi stan

thanks for your reply. i'm looking more for info on parsing strings to
keep track of quoted and parenthesized values.

thanks

neil

Nov 19 '05 #3

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

Similar topics

7
by: WindAndWaves | last post by:
Hi Gurus I am keen to make a search page on a website, but I have absolutely zero experience with PHP. I am going to hire an expert, but I thought that it may pay to try it a bit first myself...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
5
by: Lukas Holcik | last post by:
Hi everyone! How can I simply search text for regexps (lets say <a href="(.*?)">(.*?)</a>) and save all URLs(1) and link contents(2) in a dictionary { name : URL}? In a single pass if it could....
177
by: C# Learner | last post by:
Why is C syntax so uneasy on the eye? In its day, was it _really_ designed by snobby programmers to scare away potential "n00bs"? If so, and after 50+ years of programming research, why are...
28
by: joshc | last post by:
If I have an array of data that I know to be sorted in increasing order, and the array is less than 50 elements, and I want to find the first element greater than a certain value, is a simple...
4
by: Bob hotmail.com> | last post by:
Everyone I have been spending weeks looking on the web for a good tutorial on how to use regular expressions and other methods to satisfy my craving for learning how to do FAST c-style syntax...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
18
by: dlesandrini | last post by:
Has anyone noticed that the Google Groups Advanced Search no longer works correctly? Is it something I'm doing or have others noticed the change? Used to be, if I put *access* in the Groups...
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: 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
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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...
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.