Error in regex for BBedit:
What is wrong in this regex?
(?=^.{42,}$)(.{,23}\b[,.:;"!?]?\b)(.*)

problem: the comma is also moved with capture group 2, it should stay with 
capture group 1

Example, whole sentence to be split in two parts:
They get rid of things, very simple clothing.

regex with error returns:
1st line: They get rid of things
2nd line: , very simple clothing.

should be:
1st line: They get rid of things,
2nd line: very simple clothing.

punctuation mark is not included in correct capture group

I tried different patterns, like:
(?=^.{42,}$)(.{0,23}\b[\w,.:;"!?]*\b)(.*)     also not working right

(?=^.{42,}$)(.{1,23}\b(?:[,.:;"!?]?)\b)(.*)   also not working right

(?=^.{42,}$)(?<Group1>.{1,23}\b[,.:;"!?]?)\b(?<Group2>.*)   also not 
working right


Thanks a lot for your help!
Otto

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or believe that the application isn't working correctly, please email 
"[email protected]" rather than posting here. Follow @bbedit on Mastodon: 
<https://mastodon.social/@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 visit 
https://groups.google.com/d/msgid/bbedit/ed197086-4369-4272-b86d-4bcca4c466bbn%40googlegroups.com.

Reply via email to