Search code examples
regexopenoffice-calc

Search array of exact numbers in OpenOffice Calc regular expressions


I have been trying to search for an list of numbers but i have not manage to make it work.

The closest i have gotten is to search by regular expressions using

(283882|283778|283)

(See screenshot for example)

But that also matches "283977", "283938","283894" and so on.

How do i search for a exact list of numbers?

Example screenshot (sorry for swedish text)


Solution

  • You need anchors: ^ to match the beginning of a string, and $ to match the end of the string.

    Use

    (^283882$|^283778$|^283$)
    

    In most regex flavors, ^(283882|283778|283)$ should work, it is really weird you get no matches with it.