Advertisement

08.31.2002 at 07:47AM PDT, ID: 20346624
[x]
Attachment Details

Regular Expression Question

Asked by Aphroditus in Perl Programming Language

Tags: textpad, regular, expression

Hi

Is there a regular expression equivalent to an "AND" search?

---------
Ex :
This is my string in a text file.
Another string in a text file.

---------

I would like to do a search. Lets say I know 'string' and 'this' are keywords in the line, but I do not know the particular order. The only way I found of doing this is :

this.*string | string.*this

Since regular expressions has an OR(|) metacharacter, I was wondering whether it has an AND metacharacter as well, so that I could do :

this AND string

Also, is there a regular expression which could exclude certain keywords from a search?

say I want to exclude 'this', returning a match for the
Another string in a text file.
line.

I'm using a POSIX standard regex engine (Textpad) by the way.Start Free Trial
[+][-]09.02.2002 at 03:52AM PDT, ID: 7256105

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: textpad, regular, expression
Sign Up Now!
Solution Provided By: riplix
Participating Experts: 3
Solution Grade: C
 
 
[+][-]09.03.2002 at 08:48AM PDT, ID: 7259208

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.03.2002 at 09:08AM PDT, ID: 7259263

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2002 at 06:40AM PDT, ID: 7261510

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2002 at 07:52AM PDT, ID: 7261709

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.05.2002 at 09:12PM PDT, ID: 7266317

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.05.2002 at 09:20PM PDT, ID: 7266332

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.06.2002 at 12:18AM PDT, ID: 7266521

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32