2

I am searching to replace the expression below:

}} &  &  &  &  \\ 
   &  &  &  &  \\ 

in a tex file with the Find and Replace function (in Texmaker). I used the Regex because of the linebreak. I typed:

\}\} &\s &\s &\s &\s \\\\ \n \s & \s& \s& \s& \s\\\\ 

But the second part of the expression does not work :-( I think that the problem lies in the line break.

What did I miss ?

Thanks for any help !!

Ph.D.Student
  • 704
  • 6
  • 27
Flora Grappelli
  • 659
  • 9
  • 26
  • Did you check the CRLF ending? `\r\n` instead of just `\n`? Also, use `+` to match 1 or more chars. Also, `\s` matches any whitespace, you may just replace `\s` with spaces and `\n` with just `\s+`. See [`}}(?:\s+&){4}\s+\\\\\s+(?:\s+&){4}\s+\\\\`](https://regex101.com/r/1R76EW/1) – Wiktor Stribiżew Oct 08 '18 at 13:59
  • Thanks ! I tried \r\n... Nothing works. I know the expression matches on the regex translator but not in the "Search" funtion of Texmaker. I don't understand why ! – Flora Grappelli Oct 08 '18 at 14:11
  • just remove '\n', in texmaker use the double backslash for line break. – Arif Rathod Oct 08 '18 at 14:12
  • The expression "\}\}(?:\s+&){4}\s+\\\\\s*" works well for the first line. But when I add: \n, \r, \r\n, \\ or &, it doesn't match anymore – Flora Grappelli Oct 08 '18 at 14:21

0 Answers0