Regex Wildcard

  • Thread starter Thread starter per_persson_2008
  • Start date Start date
P

per_persson_2008

I use .* as a wildcard match in my regular expression. But how do I
write it if I want to match all characters except the following <>
and /
 
try [^<>/]




I use .* as a wildcard match in my regular expression. But how do I
write it if I want to match all characters except the following <>
and /- Dölj citerad text -

- Visa citerad text -

Hi, I stil have problems. For example ^.*kalle.*$ matches the
following string a<bckalleabc. If I use the following ^.*[^<>/]kalle.*
$ I get the same result.
 
Hi, I stil have problems. For example ^.*kalle.*$ matches the
following string a<bckalleabc. If I use the following
^.*[^<>/]kalle.*$ I get the same result.

The dot means "any character", and the star means "any number of these",
so you need to replace the dot with [^<>/]  and not just stick it in at
random.

^[^<>/]*kalle[^<>/]*$

[^<>/]* means "any number of characters that aren't < > /

Eq.

Thanks for the answer. Yes it works if I replace . with [^<>/]*
 
Dude ..

Try searching at regexlib.com. this is the first place for every and any
regular expressions. This is a place where you can both learn as well as use
expressions by others.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top