0

I'm using a PDF reader, iAnnotate, that allows one to search a document using java.util.regex.Pattern regexps. Unfortunately, iAnnotate ignores case in all searches. This happens even if you use an expression like [A] (it also finds "a"), and even if you specify the character in unicode (\u0041 means "A", but iAnnotate also finds "a").

Java regexps are not designed to ignore case by default, and I don't see any way to use them to override ignore-case behavior in the javadoc, but maybe there's something I'm not thinking of.

Any suggestions for possible regexp tricks to force a regexp to be interpreted with a specific case? I know that this is strictly speaking an iAnnotate question, but I am interested in possible Pattern regexp solutions.

Mars
  • 8,689
  • 2
  • 42
  • 70
  • Use inline modifie group, `(?-i:A)`, it will only match an uppercase `A` – Wiktor Stribiżew Nov 25 '19 at 18:40
  • @WiktorStribiżew Thanks! That works. I never would have figured that out. Please post it as an answer and I'll accept it. – Mars Nov 25 '19 at 18:42
  • OK, thanks for finding the duplicate @WiktorStribiżew. I didn't think this would have been asked--I was sceptical that there was a solution and didn't know what to search for. – Mars Nov 25 '19 at 18:47

0 Answers0