On 05/22/2021, at 10:50, severdia <[email protected] <mailto:[email protected]>> wrote: > I can't seem to figure out a way to find and replace some numbers using Grep. > This is what I have. > > <loc>2.2</loc><loc2>2.2.93</loc2> > > I have many cases where there are 3 numbers separated by two periods wrapped > in <loc> (like this: <loc>2.2.309</loc>) as well as the example above with 2 > numbers separated by 1 period wrapped in <loc>. I want to find where there > are only two numbers and delete that <loc> element. For example I tried:
Hey Ron, Explanations are welcome, but when asking for assistance with data manipulation it's best to provide concrete, real-world data samples and the expected results. Words nearly always include assumptions and opportunities for error. A good test case (or three) along with the expected result(s) makes it much easier for people to experiment and get the job right the first time. If I'm understanding your task correctly then this should work: Find: <loc>(\d+\.\d+)</loc> Replace: \1 -- Best Regards, Chris -- 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/CCD1E1E9-D097-4FC1-A639-66BACD41C1BF%40gmail.com.
