[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Regexp] regexp question
From: |
Shashank Bapat |
Subject: |
Re: [Regexp] regexp question |
Date: |
Fri, 11 Jun 2004 21:57:02 -0700 (PDT) |
There can be better solution based on what exactly you are trying to do.
I am assuming you have to search that word with any number of special
characters in input text.
If however you know that input text is going to be just one word I dont think
using re is good
approach.
For a given word prescriptions. Assuming there are multiple special characters
possible in a given
word -
p[^[:alpha:]]*r[^[:alpha:]]*e[^[:alpha:]]*s[^[:alpha:]]*c[^[:alpha:]]*r[^[:alpha:]]*i[^[:alpha:]]*p[^[:alpha:]]*t[^[:alpha:]]*i[^[:alpha:]]*o[^[:alpha:]]*n[^[:alpha:]]*s[^[:alpha:]]*
You can change the special character pattern more restrictive based on what you
are looking for.
If you want to do it for any given word you will have to run a for loop on that
word and generate
the above pattern and then look for that pattern in input text.
Thanks
-Shahsank
--- Chris Tatro <address@hidden> wrote:
> I am sure there is a easy way to do this with regexp but i am new to this.
> I want to search a specific word for specail characters for
> example:prescri%ptions
> But how do i search the word for a special character if it is move like:
> prescr%iptions
>
>
>
>
>
> _______________________________________________
> Gnu-regexp-users mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnu-regexp-users
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/