Patter crossing ne line boundary?

19 views
Skip to first unread message

@lbutlr

unread,
Mar 1, 2022, 4:32:20 PM3/1/22
to BBEdit Talk
I am using the following pattern:

^,,([^ ]+) ([^,@]+),

And it is matching across the EOL markers. I though the default was for pattern not to do that unless specifically told to?

It is the [^ ]+ that seems to do it.

What I am trying to match is a ",,word word," and not match ",,word,word"

--
You came in that thing? You're braver than I thought!

bva

unread,
Mar 1, 2022, 5:41:52 PM3/1/22
to bbe...@googlegroups.com
The regex component that (normally) doesn’t include line endings (eol) is the dot ‘.’, which stands for any character EXCEPT eol characters. You could also use the ‘$’ which (normally) stands for the end of the line; it would go at the end of the expression you have.

HTH

_bruce__van_allen__santa_cruz_ca_
_831_429_1688_p_
_831_332_3649_c_

> On Mar 1, 2022, at 1:32 PM, @lbutlr <kre...@kreme.com> wrote:
>
> I am using the following pattern:
> --
> This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@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+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/13F5CDD9-4D42-41D2-8713-2E2CFD25F675%40kreme.com.

ThePorgie

unread,
Mar 1, 2022, 6:25:58 PM3/1/22
to BBEdit Talk
The exception class will include the eol unless specifically told not to. You need to put a "\r" in your exception class.

I'd like to see a few more examples of your data but if you replace the exception class with a word character class it seems you might get what you're looking for
^,,([\w]+) ([\w]+),

Reply all
Reply to author
Forward
0 new messages