What if I wanted to extract all the text up to, but not including, the left 
parenthesis?

On Monday, June 1, 2020 at 9:49:58 AM UTC-4, Jean-Christophe Helary wrote:
>
>
>
> > On Jun 1, 2020, at 21:31, Howard <[email protected] <javascript:>> 
> wrote: 
> > 
> > Here is an input sample: 
> > 
> > Arizona (5) 
> > Minnesota (4) 
> > Cleveland (2) 
> > San Diego (4) 
> > 
> > Using Grep, I want to remove all the text in each item from the left 
> parenthesis on. How can I do that? 
>
> including the left parenthesis: 
> search for \(.+$ 
> replace with nothing 
>
> excluding the left parenthesis: 
> search for (?<=\().+$ 
> replace with nothing 
>
> The "exclusion" uses a "lookbehind" match as in "look behind this to see 
> if the rest matches, but only act on the rest". So here, it says "look 
> behind a left parenthesis see if you find anything" 
>
>
> -- 
> Jean-Christophe Helary @brandelune 
> http://mac4translators.blogspot.com 
>
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/bbca3dfb-ac5e-4c35-b0d5-9c693153bfe8%40googlegroups.com.

Reply via email to