CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
Regex for non-word chars excluding - (minus) and =(equals)

 



radhikj
New User

Dec 14, 2009, 12:27 AM

Post #1 of 2 (2562 views)
Regex for non-word chars excluding - (minus) and =(equals) Can't Post

Hi,

I'm trying to frame a regular expression where I have to search for the non-word characters except - and =. Currently I have put all the meta chars and non-word chars other than - &= for my search. But I think there should be alternate and easy way to get it.

For .eg., I have to search for string like abc%de_f (this regex matching this should work for any patterns with non-word chars except - and =)

Any help on this would be highly appreciated.

Thanks,

Radhika


shawnhcorey
Enthusiast


Dec 14, 2009, 7:10 AM

Post #2 of 2 (2552 views)
Re: [radhikj] Regex for non-word chars excluding - (minus) and =(equals) [In reply to] Can't Post

Try:

Code
/[^-=[:alnum:]]/


__END__

I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives