Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1877 Lượt xem

I have written what I think is a very simple regex pattern for matching transactions from my bank feed, but it's not working as expected.

this is the regex for the Label:

PARKING|TRANSPORT|SCENTRE|PARK|TOLL

the intention is to find any transaction that has any of these words in it

  • parking
  • transport
  • scentre Park 
  • toll

this is working for quite a few transactions, however I have a transaction with this label:

THE SPOT WILSON PARKING  RANDWICK CREDIT CARD PURCHASE

and for some reason it's not matching this transaction. any ideas?

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

I resolved this by creating a regex that matches the entire string, not just part of the string:

^.*(some string|some other string|patternX|patternY).*$


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 24
1425
0
thg 10 23
1996
5
thg 6 23
4477
0
thg 11 22
1829
1
thg 8 22
2973