Hello, @vishwas-bhide and All,
So your language uses the Unicode DEVANAGARI script, in range U+0900 - U+097F below :
https://www.unicode.org/charts/PDF/U0900.pdf
And :
- The **`॥`** character is *DEVANAGARI DOUBLE DANDA*, with code-point **`\x{0965}`**
- The **`०`** character is *DEVANAGARI DIGIT ZERO*, with code-point`\x{0966}`**
- The **`१`** character is *DEVANAGARI DIGIT ONE*, with code-point`\x{0967}`**
- The **`२`** character is *DEVANAGARI DIGIT TWO*, with code-point`\x{0968}`**
- The **`३`** character is *DEVANAGARI DIGIT THREE*, with code-point`\x{0969}`**
- The **`४`** character is *DEVANAGARI DIGIT FOUR*, with code-point`\x{096A}`**
- The **`५`** character is *DEVANAGARI DIGIT FIVE*, with code-point`\x{096B}`**
- The **`६`** character is *DEVANAGARI DIGIT SIX*, with code-point`\x{096C}`**
- The **`७`** character is *DEVANAGARI DIGIT SEVEN*, with code-point`\x{096D}`**
- The **`८`** character is *DEVANAGARI DIGIT EIGHT*, with code-point`\x{096E}`**
- The **`९`** character is *DEVANAGARI DIGIT NINE*, with code-point`\x{096F}`**
Your initial S/R could be changed as :
SEARCH ॥\h\d+\h॥\h(?!<br>) OR \x{0965}\h\d+\h\x{0965}\h(?!<br>)
REPLACE $0<br>
Two advantages :
No need to capture something in a group as we grab the overall match with the $0 syntax, in replacement
If the part ॥ digit ॥ is already followed with a space char and the string <br>, it will not add <br> a second time
So, two cases can be considered :
A) WITHOUT a macro :
Open the Replace dialog ( Ctrl + H )
SEARCH ॥\h\d+\h॥\h(?!<br>) OR \x{0965}\h\d+\h\x{0965}\h(?!<br>)
REPLACE $0<br>
Tick the Wrap option option
Select the Regular expression search mode
Click on the Replace All button, once ( anyway, a second click will not work ! )
B) WITH a macro :
Open the Replace dialog ( Ctrl + H )
SEARCH ॥\h\d+\h॥\h(?!<br>)
REPLACE $0<br>
Tick the Wrap option option
Select the Regular expression search mode
Run the Macro Start Recording option ( Ctrl + Shift + R )
Click on the Replace All button
Close the Replace dialog ( ESC )
Run the Macro Stop Recording option ( Ctrl + Shift + R )
Run the Save Current Recorded Macro option
Save it as, for instance, Addition of <br>
Choose, preferably a shortcut for further easy process
Click the OK button
Close and re-start Notepad++
Open your concerned file
Now, whatever the option chosen :
Macro > Addition of <br>
Macro > Run a Macro Multiple Times > Addition of <br> > Run 1 times and a click on the Run button
Macro > Addition of <br> > Run until the end of file and a click on the Run button
=> The <br> string is added to any ॥ digit ॥ string, ONLY once !
Note that the Wrap around forces the regex engine to process file(s) from the very beginning to the very end !
If you prefer to modify, directly, your active shortcuts.xml file, add the lines, below, right before the line </Macros>
<Macro name="Addition of <br>" Ctrl="no" Alt="no" Shift="no" Key="0">
<Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
<Action type="3" message="1601" wParam="0" lParam="0" sParam="॥\h\d+\h॥\h(?!<br>)" />
<Action type="3" message="1625" wParam="0" lParam="2" sParam="" />
<Action type="3" message="1602" wParam="0" lParam="0" sParam="$0<br>" />
<Action type="3" message="1702" wParam="0" lParam="768" sParam="" />
<Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
</Macro>
Best Regards,
guy038