Search code examples
filterlibreoffice-calc

How to filter a column in LibreOffice with some specific characters


I have a LibreOffice-Calc file like this:

enter image description here

There is a column called "code" here. How can I filter those based on "code" column that are in the style of ""11*-1*-91*-700"". Character * here means any character.

I mean the output is the same as this:

1121-117-912-700
1122-121-912-700
1121-117-911-700
...

Solution

  • Use a Standard Filter on the Code column. When you get to the Standard Filter dialog, click Options and check Regular expression.

    Set the Field name to Code, the Condition to = and supply the following for Value,

    ^11.?.?-1.?.?-91.?-700
    

    Each question mark (e.g. ?) represents a single wildcard character and must be accompanied by a prefix period (aka . or full stop).

            OpenOffice Calc RegEx Filter

    I didn't type out all of your sample data but I did type out enough to verify an answer.

    You will also have to make sure that Tools ► Options ► OpenOffice Calc ► Calculate has Enable regular expressions in formulas enabled.