Re: Search pattern works in Notepad++ , but not in BBEdit

2023-12-02 Thread 'wbrisett' via BBEdit Talk
I will point out that parsing XML with regex isn't really how you should do 
things... (but then I work with XML every day and I do understand there are 
some needs that XSLT and XPATH won't work for with folks). 

On Friday, December 1, 2023 at 12:54:43 PM UTC-6 Samir Vasaya wrote:

> Hi Jean,
> thanks for confirming my observations.
> yes the tag you mentioned is not closed.
> I have mailed to barebones, and I found  them to be very supportive and 
> they have promised a fix, 
> may be not soon , but they are working to solve the issue.
>
> Thanks.
> On Thursday, November 30, 2023 at 2:19:55 PM UTC+5:30 jj wrote:
>
>> Hi Samir,
>>
>> A few remarks.
>>
>> 1. The  tag is not correctly closed in you 
>> XML example.
>>
>> 2. I can reproduce the issue you mention and effectively BBEdit is 
>> returning garbage in the 'Replacement Text' field of the playground even if 
>> it shows the correct \2 in the 'Capture Groups' table.
>>
>> 3. If you use your pattern/replacement in a find/replace over you sample 
>> text and extract the results in a new document,  you can clearly see with 
>> 'File > Hex Dump Front Document' that the replacements are pointing to 
>> random memory.
>>
>> 4. There is apparently a bug somewhere.
>>
>> 5. You should send an email to sup...@barebones.com with your issue to 
>> open a case.
>>
>> HTH,
>>
>> Jean Jourdain
>>
>>
>> On Wednesday, November 29, 2023 at 9:22:15 PM UTC+1 Samir Vasaya wrote:
>>
>>> Hello.
>>> I have a .xlm file with below sample contents.
>>>
>>>  
>>>   MYNoodles_5Rs_0720
>>>   
>>>   
>>>Main Location
>>>   
>>>   
>>>
>>> -1
>>>
>>>Sales @ 12% GST
>>>  
>>>  
>>>   PF 05 CNS0720
>>>   
>>>   
>>>Main Location
>>>   
>>>   
>>>
>>> -1
>>>
>>>Sales @ 12% GST
>>>  
>>>
>>>
>>> I do a Search and Replace using Grep in BBEdit with
>>>
>>> Search pattern:
>>>
>>>
>>> (?s)(?=(?|()|.)*?(?(1)(?=([^<]+)<\/STOCKITEMNAME>)|<\/ALLINVENTORYENTRIES\.LIST>))(?(2)(?=(?|()|.)*?(?(3)(?=(\2))?|<\/ALLINVENTORYENTRIES\.LIST>))(?(3)(?(4)^\b$|.*?(?=)\K)|^\b$)|^\b$)
>>>
>>>
>>>
>>> Replace pattern:
>>>
>>> \2
>>>
>>>
>>> Im not getting the desired results, Pattern playground hi lights sub 
>>> patterns 1, 2 and 3 Correctly, But the Replacement text: for \2 shows the 
>>> captured text incorrectly.
>>>
>>>
>>> Am I m doing something wrong. I have gone through BBEdit manual, but 
>>> couldn’t find anything that helped.
>>>
>>> I ran the same pattern in Notepad++ and it works flawlessly.
>>>
>>>

-- 
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: 
--- 
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/4ed82562-1769-470b-a73c-4ee2a45d4be8n%40googlegroups.com.


Re: Search pattern works in Notepad++ , but not in BBEdit

2023-12-01 Thread Samir Vasaya
Hi Jean,
thanks for confirming my observations.
yes the tag you mentioned is not closed.
I have mailed to barebones, and I found  them to be very supportive and 
they have promised a fix, 
may be not soon , but they are working to solve the issue.

Thanks.
On Thursday, November 30, 2023 at 2:19:55 PM UTC+5:30 jj wrote:

> Hi Samir,
>
> A few remarks.
>
> 1. The  tag is not correctly closed in you XML 
> example.
>
> 2. I can reproduce the issue you mention and effectively BBEdit is 
> returning garbage in the 'Replacement Text' field of the playground even if 
> it shows the correct \2 in the 'Capture Groups' table.
>
> 3. If you use your pattern/replacement in a find/replace over you sample 
> text and extract the results in a new document,  you can clearly see with 
> 'File > Hex Dump Front Document' that the replacements are pointing to 
> random memory.
>
> 4. There is apparently a bug somewhere.
>
> 5. You should send an email to sup...@barebones.com with your issue to 
> open a case.
>
> HTH,
>
> Jean Jourdain
>
>
> On Wednesday, November 29, 2023 at 9:22:15 PM UTC+1 Samir Vasaya wrote:
>
>> Hello.
>> I have a .xlm file with below sample contents.
>>
>>  
>>   MYNoodles_5Rs_0720
>>   
>>   
>>Main Location
>>   
>>   
>>
>> -1
>>
>>Sales @ 12% GST
>>  
>>  
>>   PF 05 CNS0720
>>   
>>   
>>Main Location
>>   
>>   
>>
>> -1
>>
>>Sales @ 12% GST
>>  
>>
>>
>> I do a Search and Replace using Grep in BBEdit with
>>
>> Search pattern:
>>
>>
>> (?s)(?=(?|()|.)*?(?(1)(?=([^<]+)<\/STOCKITEMNAME>)|<\/ALLINVENTORYENTRIES\.LIST>))(?(2)(?=(?|()|.)*?(?(3)(?=(\2))?|<\/ALLINVENTORYENTRIES\.LIST>))(?(3)(?(4)^\b$|.*?(?=)\K)|^\b$)|^\b$)
>>
>>
>>
>> Replace pattern:
>>
>> \2
>>
>>
>> Im not getting the desired results, Pattern playground hi lights sub 
>> patterns 1, 2 and 3 Correctly, But the Replacement text: for \2 shows the 
>> captured text incorrectly.
>>
>>
>> Am I m doing something wrong. I have gone through BBEdit manual, but 
>> couldn’t find anything that helped.
>>
>> I ran the same pattern in Notepad++ and it works flawlessly.
>>
>>

-- 
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: 
--- 
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/463453e8-8718-4ead-a4ad-53a3e1a6dcfcn%40googlegroups.com.


Re: Search pattern works in Notepad++ , but not in BBEdit

2023-11-30 Thread jj
Hi Samir,

A few remarks.

1. The  tag is not correctly closed in you XML 
example.

2. I can reproduce the issue you mention and effectively BBEdit is 
returning garbage in the 'Replacement Text' field of the playground even if 
it shows the correct \2 in the 'Capture Groups' table.

3. If you use your pattern/replacement in a find/replace over you sample 
text and extract the results in a new document,  you can clearly see with 
'File > Hex Dump Front Document' that the replacements are pointing to 
random memory.

4. There is apparently a bug somewhere.

5. You should send an email to supp...@barebones.com with your issue to 
open a case.

HTH,

Jean Jourdain


On Wednesday, November 29, 2023 at 9:22:15 PM UTC+1 Samir Vasaya wrote:

> Hello.
> I have a .xlm file with below sample contents.
>
>  
>   MYNoodles_5Rs_0720
>   
>   
>Main Location
>   
>   
>
> -1
>
>Sales @ 12% GST
>  
>  
>   PF 05 CNS0720
>   
>   
>Main Location
>   
>   
>
> -1
>
>Sales @ 12% GST
>  
>
>
> I do a Search and Replace using Grep in BBEdit with
>
> Search pattern:
>
>
> (?s)(?=(?|()|.)*?(?(1)(?=([^<]+)<\/STOCKITEMNAME>)|<\/ALLINVENTORYENTRIES\.LIST>))(?(2)(?=(?|()|.)*?(?(3)(?=(\2))?|<\/ALLINVENTORYENTRIES\.LIST>))(?(3)(?(4)^\b$|.*?(?=)\K)|^\b$)|^\b$)
>
>
>
> Replace pattern:
>
> \2
>
>
> Im not getting the desired results, Pattern playground hi lights sub 
> patterns 1, 2 and 3 Correctly, But the Replacement text: for \2 shows the 
> captured text incorrectly.
>
>
> Am I m doing something wrong. I have gone through BBEdit manual, but 
> couldn’t find anything that helped.
>
> I ran the same pattern in Notepad++ and it works flawlessly.
>
>

-- 
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: 
--- 
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/7d195ba8-f5c6-4feb-beea-6fb0358124abn%40googlegroups.com.