Re: [Regexp] regexp question

Shashank Bapat <[email protected]>
Newsgroups gmane.comp.gnu.regexp
Message-ID <[email protected]>
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 <[email protected]> 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
> [email protected]
> http://lists.gnu.org/mailman/listinfo/gnu-regexp-users



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.