Hi, all.
There is regexp -start option, but no -stop option. How can i tell regexp command to stop matching at some position? May be i missed something?
On Tuesday, September 28, 2021 at 3:11:22 PM UTC+2, oleg wrote:
Hi, all.
There is regexp -start option, but no -stop option. How can i tell regexp command to stop matching at some position? May be i missed something?Use string range (or string replace) to remove the unwanted part of the string. Unlike for -start this does not temper with the indices.
Two caveats:
Edge case: Depending on whether look-ahead matches should have matched beyond -stop, this might not suit your expectation.
Performance: String range (and string replace) require copying (new Tcl_Obj and memcpy), but I guess the overall impact is acceptable.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 73:43:22 |
Calls: | 6,489 |
Calls today: | 2 |
Files: | 12,096 |
Messages: | 5,275,926 |