473,721 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

String search help

Hi All

I need a regular expression that retrieves the string that appears
after the "/"

As a example consider the following
Input Output
------ -------
(a/b)/c -------->c
a/b*100*(1-((c*d)/e))----->b,e
(a)-(((b)*(100-c))/(d))/((a)-(((b)*(100-c))/(d))+b*(100-c)/d---->d and

((a)-(((b)*(100-c))/(d))
((a)-(((b)*(100-c))/(d))---->d

(a+b)/((c-d)+e)*100----->((c-d)+e)
((a/b)/c)+d-----b,c
(a+b)/(c+d+e-f)*100-----(c+d+e-f)
(a+b)/((c-d)+e)*100-----((c-d)+e)

Dec 8 '06 #1
4 1094
wrote on 08 dec 2006 in microsoft.publi c.inetserver.as p.general:
Hi All

I need a regular expression that retrieves the string that appears
after the "/"
want?
As a example consider the following
[..]
((a)-(((b)*(100-c))/(d))---->d

(a+b)/((c-d)+e)*100----->((c-d)+e)
Your specification is inconsistent.

Why is the first output not (d) ?

Without a logical discription, programming is impossible.

A rule shoud be something like:

'Retrieve all substrings
between a "/" and (the next "/" or the end of string)'
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 8 '06 #2

<ka*****@gmail. comwrote in message
news:11******** **************@ n67g2000cwd.goo glegroups.com.. .
Hi All

I need a regular expression that retrieves the string that appears
after the "/"

As a example consider the following
Input Output
------ -------
(a/b)/c -------->c
a/b*100*(1-((c*d)/e))----->b,e
(a)-(((b)*(100-c))/(d))/((a)-(((b)*(100-c))/(d))+b*(100-c)/d---->d and

((a)-(((b)*(100-c))/(d))
((a)-(((b)*(100-c))/(d))---->d

(a+b)/((c-d)+e)*100----->((c-d)+e)
((a/b)/c)+d-----b,c
(a+b)/(c+d+e-f)*100-----(c+d+e-f)
(a+b)/((c-d)+e)*100-----((c-d)+e)
Can you explain why you want to do this?
Why is it relevant to ASP?
Are trying to build a parser? If so you'd be better off with a State
Machine than regular expressions.
Dec 8 '06 #3
I am doing an application in ASP and i go get the input as i specified
and i have to display the output as specified
Anthony Jones wrote:
<ka*****@gmail. comwrote in message
news:11******** **************@ n67g2000cwd.goo glegroups.com.. .
Hi All

I need a regular expression that retrieves the string that appears
after the "/"

As a example consider the following
Input Output
------ -------
(a/b)/c -------->c
a/b*100*(1-((c*d)/e))----->b,e
(a)-(((b)*(100-c))/(d))/((a)-(((b)*(100-c))/(d))+b*(100-c)/d---->d and

((a)-(((b)*(100-c))/(d))
((a)-(((b)*(100-c))/(d))---->d

(a+b)/((c-d)+e)*100----->((c-d)+e)
((a/b)/c)+d-----b,c
(a+b)/(c+d+e-f)*100-----(c+d+e-f)
(a+b)/((c-d)+e)*100-----((c-d)+e)

Can you explain why you want to do this?
Why is it relevant to ASP?
Are trying to build a parser? If so you'd be better off with a State
Machine than regular expressions.
Dec 9 '06 #4
wrote on 09 dec 2006 in microsoft.publi c.inetserver.as p.general:
I am doing an application in ASP and i go get the input as i specified
and i have to display the output as specified
1 do not toppost on usenet

2 as a programmer you have a responsibility to your employer,
not simply to do what he wants, but to explain to him what the
possibilities are and aren't. Even if it is against your immediate
financial gain. You are the expert.

3
>>(a)-(((b)*(100-c))/(d))/((a)-(((b)*(100-c))/(d))+b*(100-c)/d---->d and
Learn about string parsing first.

Reading up on Shunting yard algorithm and
reverse Polish notation will help you:

<http://en.wikipedia.or g/wiki/Shunting_yard_a lgorithm>
<http://en.wikipedia.or g/wiki/Reverse_Polish_ notation>

Then make your code to translate your string using the principles
of stack pushing and pulling involved.

4 even so it is not related to ASP, but can be done on any platform,
using vbs or js or whatever. Choose the appropriate NG for the language.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 9 '06 #5

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

Similar topics

4
2676
by: Ken Fine | last post by:
I'm looking to find or create an ASP script that will take a string, examine it for a search term, and if it finds the search term in the string, return the highlighted search term along with the words that surround it. In other words, I want the search term highlighted and shown in an excerpt of the context in which it appears. Any suggestions or pointers? This behavior is most often seen as part of a search engine. In my case, I want...
4
10534
by: JP SIngh | last post by:
Hi There I am creating a search page and need help writing the code to build the sql string. I have 3 fields on the main page which a user can choose to enter search terms in any of the 3 fields. My question is how do I write the logic so it only includes the fields in the search criteria where the user has entered anything.
9
6276
by: Durgesh Sharma | last post by:
Hi All, Pleas help me .I am a starter as far as C Language is concerned . How can i Right Trim all the white spaces of a very long (2000 chars) Charecter string ( from the Right Side ) ? or how can i make a fast Right Trim Function in c,using Binary search kind of fast algorithm ? Offcourse...I can use the classical approach too. like : Start from the right most charecter of the string to the left of the
3
12995
by: Imran Aziz | last post by:
Hello All, I am getting the following error on our production server, and I dont get the same error on the development box. Unable to cast object of type 'System.Byte' to type 'System.String'. here is the code that I used to create a table and then add columns to it later, later I populate the rows in the table.
5
5480
by: int main(void) | last post by:
Hi all, Following is my attempt to write a string search and replace function. #include <stdio.h> #include <stdlib.h> #include <string.h> /*------------------------------------------------------------------------------------------- | Function name : strrep
10
2244
by: B. Williams | last post by:
I have an assignment that requires me to write a program that uses a class, a constructor, a switch, and store the records in a text file. The second requirement is to create a function called updatePower which will search through the file looking at the names and if a name is a match, will allow you to replace the integer stored for power. I have written the program and completed the first task, but I need some assistance on the secind....
12
1347
by: Ron | last post by:
I am getting an error Option strict on disallows implicit conversion from string to long I get it for this code iStartPosition = InStr(iStartPosition + 1, RichTextBox1.Text, "A" Or "a" the "A" and "a" are underlined in blue. How can I fix this?
1
5603
by: lejason | last post by:
Hello, I am looking for a way to do a string search inside an xml. Basically, I work for a company that wants to export an XML file from and excel sheet and then have that data be presented on the web. Part of the presentation is that they want to be able to "search" for their favorite dealers. So, this will be a string search. The difficulty is, we dont have .NET, we dont have a SQL server -- all I can use is ASP classic. So, I can...
1
3272
by: nganglove | last post by:
C++ string search -------------------------------------------------------------------------------- Hello, please can any one help me? I am given an assigment in C++ to read a text file and search for certain words.If those stated words are found, then I should print the enire them including the entire line. Below is an example of such a text file Example text file: Possible failures: -> Member=1, FSce=1, MP=13.16%, atching...
5
3378
by: kanley | last post by:
I have a main table with a text description field. In this field, its populated with a string of data. I need to identify from this string of data the name of the vendor using some keywords. I have another table that contains 2 fields, one being the keywords to search for from the string of data and the other field being the vendor name to pair up with the record. How do I reference the keywords from the 2nd table and search thru the...
0
8730
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
9367
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
9215
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
9131
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
9064
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
8007
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...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
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.