David G Wagner wrote on 2022-01-07 3:52 PM:
Correct. That does work. But what if it could be either start or Start. In what you have, what would you have to change for either of those cases?

That end-of-line separator has to be a string, not a regular expression, so it's fixed. But this will work if you make the string "tart#\n" like this:

###
#!/usr/bin/env perl

my $incr        = 1;    
local $/        = "tart#\n";
        
while (<>) {
        s/^1/$incr++/es;
        print;
}
###






On Jan 7, 2022, 15:39 -0800, bbedit@googlegroups.com, wrote:

#!/usr/bin/env perl

my $incr = 1;
local $/ = "#Start#\n";

while (<>) {
s/^1/$incr++/es;
print;
}

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "supp...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+unsubscr...@googlegroups.com <mailto:bbedit+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/c6413eac-2d31-4c13-88a5-bc500fdc80a1%40Spark <https://groups.google.com/d/msgid/bbedit/c6413eac-2d31-4c13-88a5-bc500fdc80a1%40Spark?utm_medium=email&utm_source=footer>.


--
    - Bruce

_bruce__van_allen__santa_cruz__ca_

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "supp...@barebones.com" rather than posting here. 
Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/9fa89333-f2ca-577a-8e22-40b8c730b136%40cruzio.com.

Reply via email to