def buscar_texto():
doc = XSCRIPTCONTEXT.getDocument()
descriptor = doc.createSearchDescriptor()
descriptor.setSearchString('(?<=\])(.*)(?=\[)')
descriptor.SearchCaseSensitive = False
descriptor.SearchRegularExpression = True
found = doc.findAll(descriptor)
doc.getCurrentController().select(found)
for i in range(found.getCount()):
f = found.getByIndex(i)
print (f.getString())
return
seleccioname
seleccioname
seleccioname
seleccioname
seleccioname
'(?<=\[tex]).*?(?=\[\/tex])'
Sub SearchWriter()
util = createUnoService("org.universolibre.EasyDev")
opt = createUnoStruct("org.universolibre.EasyDev.SearchReplace")
doc = ThisComponent
opt.Doc = doc
opt.Search = "(?<=\[tex]).*?(?=\[\/tex])"
opt.RegularExpression = True
found = util.search(opt)
util.selectText(doc, found)
End Sub
Sub LatexToMath()
util = createUnoService("org.universolibre.EasyDev")
opt = createUnoStruct("org.universolibre.EasyDev.SearchReplace")
macro = createUnoStruct("org.universolibre.EasyDev.Macro")
macro.Library = "TexMaths"
macro.Module = "TexMathsEquations"
macro.Name = "Main"
macro.Language = "Basic"
doc = ThisComponent
opt.Doc = doc
opt.Search = "(?<=\[tex]).*?(?=\[\/tex])"
opt.RegularExpression = True
found = util.search(opt)
For i = 0 To found.getCount() - 1
sel = found.getByIndex(i)
util.selectText(doc, sel)
util.callMacro(macro, Array())
Next i
End Sub
Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 6 invitados