473,890 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Easy to use regular expression library for speech control jukebox

Hi,

I'm finishing up developing a speech control jukebox (see
intelligentjuke box.com)

Can anyone point me to the easiest to use free library that does very
basic regular expression matching and substitution? E.g. I need do
stuff like this: (perl expression follows)

$s =~ s/\&/and/g; # replace ampersands with "and"

I'm a fairly good using the c++ language, but I have little experience
setting up libraries, make files, etc. I'm using Visual C++ 6.0.
Isn't there any library where I can just add a few .cpp and .h files
to my code?

Setting up libraries seems arcane and nonstandard to me. The language
is hard enough by itself. Is there any guide to this knowledge
anywhere?

So far I've tried unsuccessfully to set up these libraries:
http://www.tropicsoft.com/Components/RegularExpression/
http://www.psyon.org/projects/pcre-win32/

Thanks,
Jeff
Jul 23 '05 #1
6 3830
Jeff wrote:
Hi,

I'm finishing up developing a speech control jukebox (see
intelligentjuke box.com)

Can anyone point me to the easiest to use free library that does very
basic regular expression matching and substitution? E.g. I need do
stuff like this: (perl expression follows)

$s =~ s/\&/and/g; # replace ampersands with "and"
I don't know how far compatible boost.regex is with perl but thats one
free library that does basic stuff.
I'm a fairly good using the c++ language, but I have little experience
setting up libraries, make files, etc. I'm using Visual C++ 6.0.
Isn't there any library where I can just add a few .cpp and .h files
to my code?


How the hell did you use the speech recognition library? Did you roll
your own?

Jul 23 '05 #2
Jeff wrote:
I'm a fairly good using the c++ language, but I have little experience
setting up libraries, make files, etc. I'm using Visual C++ 6.0.
Isn't there any library where I can just add a few .cpp and .h files
to my code?


If your runtime environment includes posix c support, you could perhaps use
the standard regex routines?

#include <sys/types.h>
#include <regex.h>

int regcomp(regex_t *preg, const char *regex, int cflags);
int regexec(const regex_t *preg, const char *string, size_t
nmatch,
regmatch_t pmatch[], int eflags);
size_t regerror(int errcode, const regex_t *preg, char *errbuf,
size_t
errbuf_size);
void regfree(regex_t *preg);

Regards

Mads

--
Mads Bondo Dydensborg ma**@dydensborg .dk
http://www.madsdydensborg.dk/

"The government of the United States is not, in any sense, founded on
the Christian religion." -George Washington, November 4, 1796

"No, I don't know that Atheists should be considered as citizens, nor
should they be considered patriots. This is one nation under God."
-George H. W. Bush

Jul 23 '05 #3
On Sat, 23 Jul 2005 10:24:38 +0200, Mads Bondo Dydensborg
<ma*****@challe nge.dk> wrote:

If your runtime environment includes posix c support, you could perhaps use
the standard regex routines?

#include <sys/types.h>
#include <regex.h>

int regcomp(regex_t *preg, const char *regex, int cflags);
int regexec(const regex_t *preg, const char *string, size_t
nmatch,
regmatch_t pmatch[], int eflags);
size_t regerror(int errcode, const regex_t *preg, char *errbuf,
size_t
errbuf_size);
void regfree(regex_t *preg);


Thanks, I like this solution best. I added the includes, but I get a
compile error. Do you know how I can fix this?
---------------------------

Deleting intermediate files and output files for project 'IntelliMusic
- Win32 Release'.
--------------------Configuration: IntelliMusic - Win32
Release--------------------
....

J:\program files\Microsoft Visual
Studio6.0\VC98\ MFC\INCLUDE\afx templ.h(1233) : error C2668: 'memset' :
ambiguous call to overloaded function
J:\program files\Microsoft Visual
Studio6.0\VC98\ INCLUDE\utility (21) : while compiling class-template
member function 'void __thiscall CMap<class CSAPrefsSubDlg *,class
CSAPrefsSubDlg *,unsigned long,unsigned long
&>::InitHashTab le(unsigned
int,int)'

....
Generating Code...
Error executing cl.exe.

IntelliMusic.ex e - 1 error(s), 0 warning(s)
---------------------------
I should probably post to a win32 ng now.
Jul 25 '05 #4
On 22 Jul 2005 15:33:29 -0700, u.********@gmai l.com wrote:
Jeff wrote:
Hi,

I'm finishing up developing a speech control jukebox (see
intelligentjuke box.com)

Can anyone point me to the easiest to use free library that does very
basic regular expression matching and substitution? E.g. I need do
stuff like this: (perl expression follows)

$s =~ s/\&/and/g; # replace ampersands with "and"


I don't know how far compatible boost.regex is with perl but thats one
free library that does basic stuff.
I'm a fairly good using the c++ language, but I have little experience
setting up libraries, make files, etc. I'm using Visual C++ 6.0.
Isn't there any library where I can just add a few .cpp and .h files
to my code?


How the hell did you use the speech recognition library? Did you roll
your own?


Uhh, yes I did! I rolled my own SR library into a big fattie and
smoked it. Now its all gone! For now I'm stuck with M$.

Ok, this is what allowed me to use the ms sapi. Without this site I
never would have started my project.

SAPI 5.0 Tutorial I: An Introduction to SAPI
http://www.generation5.org/content/2001/sr00.asp

Jul 25 '05 #5
Jeff wrote:
If your runtime environment includes posix c support, you could perhaps
use the standard regex routines?
Thanks, I like this solution best. I added the includes, but I get a
compile error. Do you know how I can fix this?


no, sorry, my knowledge about Windows is really limited.

Good luck

Mads

--
Mads Bondo Dydensborg ma**@dydensborg .dk
http://www.madsdydensborg.dk/

I disapprove of what you say, but I will defend to the death your right to
say it.
- Beatrice Hall [pseudonym: S.G. Tallentyre], 1907 (many times wrongfully
attributed to Voltaire)

Jul 25 '05 #6
>>>If your runtime environment includes posix c support, you could perhaps
use the standard regex routines?

Thanks, I like this solution best. I added the includes, but I get a
compile error. Do you know how I can fix this?


no, sorry, my knowledge about Windows is really limited.


Windows is not POSIX compliant and has no built-in regular expression
library.

You'll have to go find one. Henry Spencer wrote one for wxWidgets which is
freely available. PCRE (Perl-compatible regular expressions) lib is free and
has C++ wrappers. These things can be found with Google.

--John Ratliff
Jul 26 '05 #7

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

Similar topics

5
2541
by: Bradley Plett | last post by:
I'm hopeless at regular expressions (I just don't use them often enough to gain/maintain knowledge), but I need one now and am looking for help. I need to parse through a document to find a URL, and then reconstruct another URL based on it. For example, I need to scan a web page looking for something like <a href="some_dir/list_20050815100225.csv">. I don't know in advance what the date/time in the file name will be. I need to take the...
4
5189
by: Buddy | last post by:
Can someone please show me how to create a regular expression to do the following My text is set to MyColumn{1, 100} Test I want a regular expression that sets the text to the following testMyColumn{1, 100}Test Basically I want the regular expression to add the word test infront of the
12
2674
by: Laser Lu | last post by:
Hello, everybody, do you know how to use this Grouping Construct? (?> ) I've found its reference on MSDN, but still can not understand it totally. The following is its description: Nonbacktracking subexpression (also known as a "greedy" subexpression). The subexpression is fully matched once, and then does not participate piecemeal
2
5584
by: S.Kartikeyan | last post by:
I have the following problem. I am using the follwing Regular Expression validator(REV) with validator expressions ^{1,2}$ ^{3,20}$ The idea of the first exp is 1 or 2 digits the idea of second expression is username between 3 and 20 chars When the user enters characters other than the specified REVs are working. But if the user leaves the textbox without entering anything Page.IsValid is true which indicates it is not performng any...
7
371
by: norton | last post by:
Hello, Does any one know how to extact the following text into 4 different groups(namely Date, Artist, Album and Quality)? - Artist - Album Artist - Album - Artist - Album - Artist - Album- i have try this syntax but it failed
4
4845
by: lucky | last post by:
hi there!! i'm looking for a code snipett wich help me to search some words into a particular string and replace with a perticular word. i got a huge data string in which searching traditional way mean to secrife lots of time in asp.net. can any one give me such a expression in which i pass a data string and search word string and replace word string? if so plz help me out. i'm in badly need.
9
3364
by: Pete Davis | last post by:
I'm using regular expressions to extract some data and some links from some web pages. I download the page and then I want to get a list of certain links. For building regular expressions, I use an app call The Regulator, which makes it pretty easy to build and test regular expressions. As a warning, I'm real weak with regular expressions. Let's say my regular expression is:
3
1313
by: Lee Grissom | last post by:
I want to parse the following string into 3 parts per match. I almost got it, but my expression has a flaw in it. I tried this, but didn't quite work the way I expect on the second match b/c there's no space before the symbol. <§\s(.*?)\s*;?\s(.*?)\s*>(.*?)</§> You must<§ Control.exe; Printers>add a printer</§from the <§ Control.exe>control panel</§>.
8
3123
by: Uwe Schmitt | last post by:
Hi, Is anobody aware of this post: http://swtch.com/~rsc/regexp/regexp1.html ? Are there any plans to speed up Pythons regular expression module ? Or is the example in this artricle too far from reality ??? Greetings, Uwe
0
9976
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10908
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10451
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9618
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8008
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
5835
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
6035
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4665
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 we have to send another system
3
3267
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.