Search code examples
replacefindnotepad++digits

Remove the digit(s), the comma and the space at the left part of the line


Sample data:

(17, ' Antonio Moreno Taquería (Restaurant) - 'Page 2' <br> ('4 februari 2024'),

(1, ' Cactus Comidas para llevar (Pizza) - 'Page 45' <br> ('7 april 2023'),

(58679, ' Drachenblut Delikatessen  Sven Ottlieb (Bar) - 'Page 22' <br> ('24 februari 1998'),

(19786453679, ' Furia Bacalhau e Frutos do Mar (Brasserie) - 'Page 21' <br> ('31 december 2001'),

(9871236, ' Hungry Coyote Import Store (Bar) - 'Page 87' <br> ('19 march 1988'),

(236, ' Magazzini Alimentari Riuniti    Giovanni Rovelli (Restaurant) - 'Page 256' <br> ('12 june 1984'),

I want to remove the digit(s), the comma and the space at the left part of the line but only 1 time per line.

Desired Result:

(' Antonio Moreno Taquería (Restaurant) - 'Page 2' <br> ('4 februari 2024'),

(' Cactus Comidas para llevar (Pizza) - 'Page 45' <br> ('7 april 2023'),

(' Drachenblut Delikatessen Sven Ottlieb (Bar) - 'Page 22' <br> ('24 februari 1998'),

(' Furia Bacalhau e Frutos do Mar (Brasserie) - 'Page 21' <br> ('31 december 2001'),

(' Hungry Coyote Import Store (Bar) - 'Page 87' <br> ('19 march 1988'),

(' Magazzini Alimentari Riuniti Giovanni Rovelli (Restaurant) - 'Page 256' <br> ('12 june 1984'),

I tried all kind of variations like ^.*(?=') but Regex is absolutely not my field of expertise and it's all 'trial and error' what I'm doing. Please guide me in the right direction.


Solution

    • Ctrl+H
    • Find what: ^\(\d+,\h*
    • Replace with: \(
    • TICK Wrap around
    • SELECT Regular expression
    • Replace all

    Explanation:

    ^           # beginning of line
    \(          # open parenthesis
    \d+         # 1 or more digits
    ,           # a comma
    \h*         # 0 or more horizontal spaces