I want to know : can we using InDesign Script to select any text between 2 specific glyph + if the selected text at the beginning of line ( beginning of line . not the beginning of paragraph ) ... then change it to specific word + create a new character style for the selected text .

this is an example of my work in Arabic : if we want InDesign to select any text between these 2 glyphs ... then if the selected text located at the beginning of any line in paragraph ( not at beginning of paragraph ) replace the selected text to another text like " بسم الله "

then create a new character style for the converted text ( بسم الله ) :

the problem not with GREP but with scripting >>> if the selected text ( by GREP ) located at the beginning of line ... replace the selected text to another text >>> then create a new character style for the new text .