0 votes
654 views

L.S.
As explained on the lingtrans wiki page, it is possible to use the location field in \fig Paratext to indicated whether an image is for Print, App or Web use. On that wiki page it refers to the document below with the following words :" Your typesetter / app creator will need to use similar rules to filter out figures that do not belong in the output that they are creating. "

Details can be found here : Indic Typesetting Collaboration Document - Google Docs

It says there: … “In SAB, to filter out images that should not be used in an app (‘a’), use regex rules that filter out images that are only for ‘p’ or ‘w’:”

Find:

(?i)\fig ([^|]|){3}([pw]+)|[^]\fig* Replace with nothing. (For USFM 2)

(?i)\fig [^]\bloc="[pw]+"[^]\fig* Replace with nothing. (For USFM 3)

Has somebody used these regexes and got them working ? I have but they do not seem to work. Any help or guidance you can give is appreciated.
goodgoan
ps Just posted this in the SAB forum as well, and hoping for some regex input here as well. Thanks in advance.

Paratext by (347 points)
reshown | 654 views

2 Answers

0 votes
Best answer

Thank you @anon291708 for this suggestion. I’m having trouble typing the same single quote as you are.

I type this:

image

And it comes out like this:

image

Any suggestions?

by [Moderator]
(2.1k points)

Perhaps the backquote character (`)? That is, two of those characters before and two after the text you want to protect.
example text

\\fig (?+) \\r\\n\\p[0-9]+

That’s it! Thanks.

For US keyboards, that is in the upper-left of the keyboard, on the same key for tilde ~.

0 votes

after (?i) y9ou only have one \. you need 2 \

by (571 points)
reshown

Hello anon467281, thanks for your quick reply. I don’t know how that backslash dropped dropped out while copy and pasting … it actually is with two backslashes in SAB :
(?i)\fig ([^|]|){3}([pw]+)|[^\]\fig*

once more (?i)\fig ([^|]|){3}([pw]+)|[^\]\fig* This is weird, this editor changes all the double slashes in single slashes. Any tips on how to regexes here that are not changed by this editor?

Hello anon467281,
The solution was here:

image SIL Scripture Software Community – 3 May 21

image

Regex to exclude images meant for print does not work

What it shows above is not the actual regex. There are missing backslashes, and some of the asterisks have been converted into italic formatting. Are you actually using these regexes? Find: (?i)\\fig ([^|]*\|){3}([pw]+)\|[^\\]*\\fig\* (For USFM...

Thanks,
goodgoan

The best way is to mark them as “code” by putting them inside double single backquotes: ``{regex}``
e.g.: (?i)\\fig ([^|]*\|){3}([pw]+)\|[^\\]*\\fig\*

Related questions

0 votes
1 answer 272 views
We like our consultant to see the images we're using, so we put them right in the Back Translation. The interlinear ... for the images. Perhaps there's already such an option?
viverechristus 296 asked Aug 24, 2021
0 votes
2 answers 540 views
Dear reader. I would like to find \fq followed by any string thing including ɛ ɔ ɲ ŋ until the first \\ft ... the search to the first non-occurance? Thanks in advance, Bart
goodgoan 347 asked Aug 3, 2023
+1 vote
5 answers 798 views
I want to change lowercase to uppercase in certain situations - for instance I want to change all lowercase after a colon to ... very simple list and then adding to it as you go.
Phil_Leckrone 9.8k asked Mar 2, 2022
0 votes
1 answer 250 views
A translator added images to their project and then tried to do an Internet S/R. It was 100+ MB, so he cancelled ... | Papua New Guinea [Email Removed].pgmailto:[Email Removed].pg
SIL LSS PNG 411 asked Feb 13, 2017
0 votes
3 answers 452 views
I cannot seem to find the EXE for Paratext RegEx Pal for PT8. Can anybody help me? Thanks, SIL+LSS+PNG
SIL LSS PNG 411 asked Mar 15, 2018
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
For just as each of us has one body with many members, and these members do not all have the same function, so in Christ we, though many, form one body, and each member belongs to all the others.
Romans 12:4-5
3,037 questions
5,994 answers
5,661 comments
2,022 users