in reply to Re^5: Using pos() inside regexp (no /e)
in thread Using pos() inside regexp
There isn't two functions with the same name. (That doesn't even make sense.) It's not read-only.
s/// uses the specified position when it starts matching (not in the middle), and only for \G. As mentioned by someone else, it makes no sense to modify the pos s/// uses in the middle of its operation.
If you want to move pos back, you would want to the input with one thing, then replace it again with something else. Replace it with the right thing the first time.
If you want to move pos forward, s/// has no way to know what you want to do with the chunk you're skipping over. Should it be copied? Should it be replaced?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Using pos() inside regexp (no /e)
by andal (Hermit) on Oct 13, 2010 at 08:58 UTC | |
by ikegami (Patriarch) on Oct 13, 2010 at 16:02 UTC | |
by andal (Hermit) on Oct 14, 2010 at 10:03 UTC | |
by ikegami (Patriarch) on Oct 14, 2010 at 16:24 UTC | |
by andal (Hermit) on Oct 15, 2010 at 07:35 UTC | |
|