How about this?

Copy the entire document to a new document.
Use the add line numbers command to add line numbers to the lines in the new 
document.
Use the process lines containing command on the new document, using your grep 
pattern, with the output options parameter set to { copying to clipboard: 
false, copying to new document: false, deleting matched lines: true, reporting 
results: false }.

Now your new document should contain just the lines of the original document 
that don't match your grep pattern, prefixed with their original line numbers

Regards,

        Neil Faiman.

> On Apr 30, 2020, at 6:38 PM, Rick Gordon <li...@rickgordon.com> wrote:
> 
> I'm trying to AppleScript a solution using BBEdit (using AppleScript because 
> there are multi-application communications) where I could flag the line 
> number and content of all lines in a document not matching a complex regex 
> string.
> 
> For instance, if I wanted to flag all lines in document that did *NOT* 
> produce a match to:
> 
> ^[A-Z0-9._%+-]{1,64}@(?:[A-Z0-9-]{1,63}\.){1,125}[A-Z]{2,63},[^,\r]*,[^,\r]*\r
> 
> That is, lines not structured as below:
> 
> * a line starting a possibly multi-subdomained email address
> * a comma, optionally followed by some text
> * a second comma, optionally followed by some more text
> 
> …how should I proceed? Is there a regex that can match those, or do I need a 
> more complex approach. I ultimately want to get a string of the unmatched 
> lines (preferably with line numbers) to throw into a dialog.
> 
> Thanks.
> 
> _______________________________________
> RICK GORDON
> _______________________________________
> 
> -- 
> 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/5EAB536A.2060708%40rickgordon.com.

-- 
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/C4315342-6B5A-4DD2-87F0-4C93FC1C1CD2%40faiman.org.

Reply via email to