English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

/[^a-zA-Z0-9 ˆ¸‰÷‹ƒ\-]/

I'd love to know what and what not this would match. Also, what do the /'s at the front and end mean?

2007-06-29 12:44:10 · 6 answers · asked by smarty_pockets 2 in Computers & Internet Programming & Design

6 answers

I don't know what language you got this from but there is similar usage within PERL

In PERL there is a text search function m/ / which uses special metacharacters to define a search.
if ($name = m/[BW]ill/) this would look for the names Will & Bill

/[^a-zA-Z0-9 ˆ¸‰÷‹ƒ\-]/ These look like metacharacters the series of letters within the braces [ ] define what will be either included or excluded. Usually the carret ^ mean exclude the following set in this case small case letters a to z and uppercase letters, numbers and all other characters following the carret would be excluded .

The slashes / are delimiters which contain the metacharacters within the command operator (m) and a forward slash \ is used as an escape character in combination with a letter for special options.

for example \W is defined to be shorthand for [^a-zA-Z0-9]

So in PERL you could rewrite m/[^a-zA-Z0-9 ˆ¸‰÷‹ƒ\-]/
as m/[\Wˆ¸‰÷‹ƒ\-]/.

2007-06-29 13:26:04 · answer #1 · answered by MarkG 7 · 1 0

It is from a Perl code, yes? Those / are quotation marks specific to Perl saying it is a regex not string.

2007-06-29 20:10:23 · answer #2 · answered by Andy T 7 · 1 0

Im sorry man i usually dont indulge into jokes when im helping out with tech info on yahoo but that was really funny,you call that a REGULER expression?i have never across such term in my lifetime so far.i'll keep a check on this question to see if anybody has the answer to that.

2007-06-29 20:05:01 · answer #3 · answered by Spikey 2 · 0 2

That looks like an invalie regex

2007-06-29 19:55:36 · answer #4 · answered by Neil 1 · 2 0

It means "I farted!"

2007-06-29 19:52:15 · answer #5 · answered by Anonymous · 0 3

sorry........... i didn't get that far in school!

2007-06-29 19:48:02 · answer #6 · answered by Anonymous · 0 3

fedest.com, questions and answers