1

I am updating an SRX rules file using the SRX specification www.ttt.org/oscarstandards/srx/srx10.html

There is no explicit mention of how to make a break both before and after a certain text.

In a document the bullet character \u2022 appears and in needs to be in its own segment, thus there needs to be a break both before and after.

The only solution I came up with is:

<rule break="yes">
    <afterbreak>\u2022</afterbreak>
</rule>
<rule break="yes">
    <beforebreak>\u2022</beforebreak>
</rule>

Is this a correct syntax?

ib11
  • 2,530
  • 3
  • 22
  • 55
  • 1
    Yes, it says it supports `\uXXXX` entities. Although it also says it supports `\x{XXXX}`, too, so you may as well use `\x{2022}` – Wiktor Stribiżew Jun 29 '17 at 23:39
  • 1
    Did you try your rules before posting the question? – Wiktor Stribiżew Jun 30 '17 at 07:00
  • Thanks @WiktorStribiżew unfortunately this was for a remote server and I had no possibility to test it before deploying. I took a blind shot, and it worked. Thanks for your help. – ib11 Jun 30 '17 at 22:13

1 Answers1

1

As per the 1.2. Regular Expressions section, 1.2.1. Metacharacters table:

\uhhhh    Match the character with the hex value hhhh.
...
\x{hhhh}    Match the character with hex value hhhh
\xhh    Match the character with two digit hex value hh

You may use any of the three notations, but I guess you may just keep you SRX rules as it.

Wiktor Stribiżew
  • 607,720
  • 39
  • 448
  • 563
  • 1
    As a note, what the documentation does not cover is how to segment the same line twice, in this case both before and after the bullet character. So in such instances I have to first put a break before it, thus the first rule must be the rule and then the second rule is that we put a break after it, otherwise the bullet comes before the break, with the rule. Maybe you also want to edit this into your answer to make it all-inclusive. – ib11 Jul 10 '17 at 07:06