Feature request #4099

Enhancement: add support for wildcards to the field calculator

Added by Alister Hood almost 13 years ago. Updated over 12 years ago.

Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:14081


It would be very useful to be able to do things like this:

Or maybe that should be this (I don't understand why SQL has LIKE instead of allowing the use of wildcards with an "="):


#1 Updated by Jürgen Fischer almost 13 years ago

  • Status changed from Open to Closed

regexp_replace added in 6c26773f9bd689bfe3002c4cdb349301419a8daa

You can do regexp_replace(Descrip,'^.*\\\\(', '') now. See also QString::replace

#2 Updated by Alister Hood almost 13 years ago


#3 Updated by Alister Hood over 12 years ago

Thoughts for my future reference:

Wildcards can be used instead of full regular expressions, by adding the second line here:
QRegExp re( value2.string() );

QRegExp re( value2.string() );

WildcardUnix suffers from https://bugreports.qt.nokia.com//browse/QTBUG-10192,
which I think is why (if there was a function using it called wildcard_replace) you would need to do wildcard_replace(Descrip,'\\\\**','') rather than wildcard_replace(Descrip,'\\\\*','')

Using WildcardUnix I thought that you should be able to do wildcard_replace(Descrip,'\\\\\\\\','') if you need to replace a literal \\, but it doesn't seem to work.

- Many users would be scared of regular expressions
- I imagine most of the time the desired results could be achieved using wildcards rather than full regular expressions, and it would be simpler and faster.

Also available in: Atom PDF