Feature request #4099

Enhancement: add support for wildcards to the field calculator

Added by Alister Hood almost 6 years ago. Updated almost 6 years ago.

Status:Closed Start Date:07/19/2011
Priority:Normal Due date:
Assigned to:- % Done:


Target version:-
Platform: Resolution:
Platform version: Pull Request or Patch supplied:No
Status info: Tag:


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 "="):


Updated by J├╝rgen Fischer almost 6 years ago

  • Status changed from Open to Closed

regexp_replace added in 6c26773f9bd689bfe3002c4cdb349301419a8daa

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

Updated by Alister Hood almost 6 years ago


Updated by Alister Hood almost 6 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