I saw in another article that BeyondCompare can't ignore line breaks (or at least couldn't at the time) so I assume this is a lost cause. However, we have a few hundred files that we've replaced tags in the files (example: {my_tag}some content{/my_tag}
has changed to {new_tag}some content{/new_tag}
.
In some cases, the first tag + content could have only been 5lines and the new tag + content is 10lines. Is it possible to ignore these changes?
I tried {my_tag((.|\n)*){\/my_tag(.*)
which seemed to work in regex101, but I get errors when trying to put that in BeyondCompare.
Thanks for any help.
If you're ignoring all instances of {my_tag}..{/my_tag} and {new_tag}..{/new_tag} and the content within them, you can do that as a grammar element as part of the file format, rather than using the "Unimportant Text" section of the Session Settings dialog (where the regex is limited to a single line).
If you don't have a custom file format for the files yet, you'll need to create a new one first. If you do, skip to step 6. Apologies in advance for how many steps this is; the UI needs a redesign.
Once the file format is set up in the system and you have it loaded for your files:
a. Give the element a name like "Ignored tags"
b. Change the "Category" to "Delimited"
c. In "Text from" enter
{(my|new)_tag}
and in "to" put{/(my|new)_tag}
d. Check the "Regular expressions" option.
e. "Match character case" affects whether the search strings are case sensitive or not. "This element is case sensitive" controls whether differences in case between the two sides are treated as an important difference.
f. Click "Ok"
Once all of that is set up, it should work automatically going forward, and if you need it, you can add syntax highlighting for the element in the Options dialog under "Colors, Fonts".