Hi all,
I have a query like this:-
((A AND B) NOT (C AND D) AND (N OR M) NOT (E AND F))
I want to store
((A AND B) AND (N OR M)) in one array.
(C AND D) NOT (E AND F) in other array.
means NOT terms in one array other terms in other array in perl.
How do i do that?
pls help me.
with regards
Archana
9 1603 KevinADC 4,059
Recognized Expert Specialist
I am totally confused by your question. Have you tried any code yet we can look at?
basically the query is like this :-
((A AND B) NOT (C AND D) AND (E OR F) NOT (N AND M))
i want to separate the terms i.e
(A AND B) AND (E OR F) something like rearrangement without NOT terms.
and NOT terms in separate array.
finally my output:-
a)(A AND B) AND (E OR F)
b)(C AND D) NOT (N AND M)
more specifically NOT terms in one array and other terms in other array.
KevinADC 4,059
Recognized Expert Specialist
how do you know (A AND B) belongs in the AND group? There is no AND or NOT in front of it. Have you tried any code yet we can look at? (he asks for the second time).
numberwhun 3,509
Recognized Expert Moderator Specialist
basically the query is like this :-
((A AND B) NOT (C AND D) AND (E OR F) NOT (N AND M))
i want to separate the terms i.e
(A AND B) AND (E OR F) something like rearrangement without NOT terms.
and NOT terms in separate array.
finally my output:-
a)(A AND B) AND (E OR F)
b)(C AND D) NOT (N AND M)
more specifically NOT terms in one array and other terms in other array.
Archanak,
I have to agree with Kevin 100%. You really need to post the code that you have tried thus far so that we can help you troubleshoot it. We won't write your script, but will certainly troubleshoot it with you so you can learn.
Regards,
Jeff
how do you know (A AND B) belongs in the AND group? There is no AND or NOT in front of it. Have you tried any code yet we can look at? (he asks for the second time).
Hi Kevin,
suppose my query is like this:-
((A AND B) NOT (C AND D) AND (M AND N) NOT (P OR Q))
i tried like this:- -
if($query=~/(.*)\sNOT\s\(([^()]+)\)(.*)/g)
-
{
-
$key=$1;
-
$sec=$2;
-
$third=$3;
-
print "<br>first =$key<br>";
-
print "<br>second=$sec<br>";
-
print "<br>third=$third<br>";
-
$final=$key."".$third;
-
print "<br>****final value=$final<br>";
-
if($final=~/(.*)\sNOT\s\(([^()]+)\)(.*)/)
-
{
-
$term=$1;
-
$sterm=$2;
-
$lterm=$3;
-
print "< br>TERM=**************$1**<br>";
-
print "<br>STERM=******$2<br>";
-
print "<br>LTERM=*****$3<br>";
-
}
-
}
-
i.e first i have used regular expression to filter NOT terms
i have stored the terms in $1, $2& $3
and check again if it has NOT terms then again store $1,$2....
But if many NOT terms this will not work.
numberwhun 3,509
Recognized Expert Moderator Specialist
Archanak,
I have edited your post and corrected it for top posting. Please do not put your replies above the quoted text, otherwise
flow.
natural
conversations
the
follow
easily
wont
we
Regards,
Jeff
KevinADC 4,059
Recognized Expert Specialist
Hi Kevin,
suppose my query is like this:-
((A AND B) NOT (C AND D) AND (M AND N) NOT (P OR Q))
But if many NOT terms this will not work.
You need to create a list of the pattern matches. Generally you can do that by returning the value of a regexp to an array and use the "g" option with your regexp.
@list = $foo =~ /(pattern)/g;
You need to create a list of the pattern matches. Generally you can do that by returning the value of a regexp to an array and use the "g" option with your regexp.
@list = $foo =~ /(pattern)/g;
Hi kevin,
can u explain more about how to implement?
with regards
KevinADC 4,059
Recognized Expert Specialist - my $string = '((A AND B) NOT (C AND D) AND (E OR F) NOT (N AND M))';
-
my @not = $string =~ /NOT (\(\w AND \w\))/g;
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Karl Rhodes |
last post by:
Ok, we think we have a problem which SHOULD be simple to resolve but
appears to be impossible (unless we're not as good as we thought we
were!!!)
We have seperate workstations on which we do our development.
We have a seperate server running IIS which hosts all our development
websites.
We have a seperate fileserver where all our source code is kept in a
very neat file structure.
|
by: Shannan Casteel via AccessMonster.com |
last post by:
I have a form for entering part numbers along with the associated quantity
for each part. There are 25 Part fields and 25 associated Quantity fields.
If I go to record 1 and enter part number 1234 for part1, 3 for quantity1,
and 1235 for part2, 8 for quantity2, and on record 2 I enter 1236 for part1,
2 for quantity1, and 1234 for part2, 2 for quantity2, how would I get Access
to spit out a report that says something like this:
Part...
|
by: ern |
last post by:
I'm using scanf("%s",userInput) to capture up to three words from the
user. I want to seperate those three words into three variables:
char * firstWord;
char * secondWord;
char * thirdWord;
Is there an easy way/function that can do this already? Thanks!
|
by: Serge |
last post by:
Hi,
I have some intensive code that is running on my main thread. I try to show
a status update on a 'status form'. The problem that i have is that because
it is running in the same thread the window is not responding to the user.
The user is now able to minimize, move the window because the code is too
busy on it's own work.
(and they are all running on the same thread)
|
by: Brian Keating EI9FXB |
last post by:
Hello all,
Wonder what approach is used for this problem.
I have a MDIApplication, the MDIClinets are to be in a seperate thread.
So I've done something like this,
// Create a new Show method that starts a new thread
public new void Show()
{
Thread t = new Thread(new ThreadStart(ThreadProc));
| |
by: feng |
last post by:
In our VB.Net application, we need to be able to start
another process (thread won't do it) and run some logic in
it, and still be able to communicate with the main
process. Is this possible and how to do it?
Thanks
|
by: Kyle Teague |
last post by:
What would give better performance, serializing a multidimensional array
and storing it in a single entry in a table or storing each element of
the array in a separate table and associating the entries with the entry
in the other table?
Having a separate table would result in two queries instead of one, but
you wouldn't have to deal with the overhead of serializing and
unserializing data.
-- Kyle
|
by: bloukopkoggelmander |
last post by:
Hi All wonderfull brains!
Right I have two questions after my last very successfull thread. I have tried looking these up on the net, but no luck.
Scenario 1 is : I have a bound form with bound controls. For one of the controls I look up the values from a table, but the values I then sleect from this combo box, is concatednated, ie. Lastname,Firstname,Employee number. Now what I want is that once the user has selected a concatenated name...
|
by: cmrhema |
last post by:
Hello
I want to separate or say split a string.
Eg. I have a word Client Server
It should be split as
Client
Server
I went and searched and got it
string MainString = "String Manipulation";
|
by: desertavataraz |
last post by:
I am going write an application in C++ that allows the user to see two languages at once, and allows them to search each individual language for words or keywords. I have a font that I made specially for the non-English language, which would allow me to simply use different fonts for each specific language. I could also control how the search works simply by reading the font tags, for each language, so I only get results in that specific...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |