0

I have filename as Day=17_$folder$,trying to exclude this particular file given in a regular expression in Java.

I have tried [^Day=17_$folder$]

mjrezaee
  • 1,100
  • 5
  • 9
jrk
  • 175
  • 2
  • 9
  • can you provide some clear example? – mjrezaee Jul 31 '20 at 22:14
  • 2
    To match this exact filename, you may use `^Day=17_\$folder\$$` (possibly with a `CASE_INSENSITIVE` flag). Now, to _exclude_ it, the easier way is to use the same pattern and only proceed if there is _no match_. – 41686d6564 stands w. Palestine Jul 31 '20 at 22:15
  • Side remark: `[...]` is about matching a single character only. – tevemadar Jul 31 '20 at 22:24
  • Can `Day=17_$folder$` really be a filename ? It looks like variable assignment. If it is an exact literal, shouldn't a simple `str != 'Day=17_$folder$`` work ? –  Jul 31 '20 at 22:30

0 Answers0