'Invalid syntax in regular expression' when making a Change using \

I’m trying to find and replace all instances of \k and \k*, which are marking glossary words throughout the Biblical text and bolding them in the app (which I don’t want). The ‘invalid syntax’ seems to be the forward slash ’ \ ’ ; if I change it to a back slash, I get no error - but it will not accomplish what I want to do.

Anyone know a way around this error?

Also for the developers… it would be great if there was some way to enable changes for some books and not for others. Specifically, I would like to be able to remove all bolding of words marked with ‘\k \k*’ in the Biblical text but not in the glossary.


Hey Neil, I hope this is the kind of information that you’re looking for.

To find a \ in regex, you’ll need to “escape” it by preceding it with another slash: \\. Same goes for *. You’ll need \\k\* to find \k*.

Shouldn’t those \k in the text be \w in order to properly mark up glossary entries? Won’t SAB hyperlink them, if you use \w?

Hey Drew!

Thanks for the help! That did it! Gotta learn regex convention! (BTW… for others reading this, I just found a cool interactive site that teaches basic regex convention… https://regexone.com/lesson/introduction_abcs)

You’re right, those \k should be \w in the Biblical text (not in the glossary). I’m not sure why they aren’t. In any case, for this particular project the hyperlinks are not wanted, since the glossary is quite small.

I actually now found an item in the Styles section of the SAB project entitled ‘span.k’ (under ‘Special Text’). I could have switched the font weight from Bold to Regular and that would have also done what I wanted. However I would like if the words in the glossary itself could remain bolded. Any creative ideas as to how I could make this happen? Too bad that I can’t deselect the glossary as a book to which I don’t want to apply changes.

Maybe I should go to the guy I’m working with and ask him if he can convert all of the \k and \k* in the Biblical text to \w and \w*??

Thanks again and nice to chat with you my friend!

1 Like

If the styles cascade properly, you should be able to specify separate styling for span.k which are found on the glossary page (i.e., under body.glossary or span.glossary?) and span.k which are found in the text (i.e., under body.contents?). Perhaps one of the developers can shed some light on cascading styles within the app.