Ask Your Question
1

Regex, access to backreference using a macro

asked 2019-11-15 14:36:28 +0100

torreone gravatar image

updated 2019-11-15 14:42:26 +0100

Does searching with regular expressions with a macro that uses xSearchDescriptor allow, in each instance found, to access the substrings associated with any backreferences (group 1, 2, etc.)?

It is certainly possible to do this with a second search performed on each instance found using xTextSearch, but it seems to me a repetition, even if only on a portion of text already filtered, of something that should already have been identified by the first search with xSearchDescriptor

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2019-11-15 15:51:17 +0100

erAck gravatar image

Unfortunately not (or not that I'm aware of). The com.sun.star.util.XSearchable find...() functions' interfaces returned lack the com.sun.star.util.SearchResult context of the com.sun.star.util.XTextSearch interface (or com.sun.star.util.XTextSearch2 fwiw).

edit flag offensive delete link more

Comments

I had come to the same conclusion, but I wanted a confirmation. The first search with xSearchDescriptor will be used to limit the text to be reworked, and then with xTextSearch the strings found will have to be reworked. Thank you very much

torreone gravatar imagetorreone ( 2019-11-15 16:30:17 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-11-15 14:36:28 +0100

Seen: 19 times

Last updated: Nov 15