0 votes

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 (320 points)
reshown

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.0k 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

+1 vote
5 answers
0 votes
1 answer
0 votes
3 answers
Paratext Mar 15, 2018 asked by SIL LSS PNG (411 points)
Welcome to Support Bible, where you can ask questions and receive answers from other members of the community.
Accept the one whose faith is weak, without quarreling over disputable matters.
Romans 14:1
2,633 questions
5,375 answers
5,046 comments
1,420 users