Re: regexp [. .]
in message [EMAIL PROTECTED], wrote [EMAIL PROTECTED] thusly... On Wed, 17 Jan 2007 07:15:34 +0500, Parker Anderson [EMAIL PROTECTED] wrote: Is there a certain match you are trying to pattern? From the looks of it, [ch]* would match a similar set of characters, but it isn't as strict about which pattern they should be in. I need 'some[^[.pattern.]]' working, i.e. matching 'some' if it isn't followed by 'pattern'. Curiously that seems there isn't additional information about it somewhere except the page you've denoted. I missed the beginning of the thread, but in case you are|can use perl, following use of zero-width negative look-ahead assertion will match 'some' that is not followed by 'pattern' ... 'm/some(?!pattern)/' See perlre(1), (?!pattern) section ( around it) for details. - Parv -- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: regexp [. .]
On Wed, 17 Jan 2007 07:15:34 +0500, Parker Anderson [EMAIL PROTECTED] wrote: Is there a certain match you are trying to pattern? From the looks of it, [ch]* would match a similar set of characters, but it isn't as strict about which pattern they should be in. I need 'some[^[.pattern.]]' working, i.e. matching 'some' if it isn't followed by 'pattern'. Curiously that seems there isn't additional information about it somewhere except the page you've denoted. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
regexp [. .]
I need to use regular expressions with a sequence of characters as a collating element. From re_format(7): Within a bracket expression, a collating element (a character, a multi- character sequence that collates as if it were a single character, or a collating-sequence name for either) enclosed in `[.' and `.]' stands for the sequence of characters of that collating element. The sequence is a single element of the bracket expression's list. A bracket expression containing a multi-character collating element can thus match more than one character, e.g. if the collating sequence includes a `ch' collating element, then the RE `[[.ch.]]*c' matches the first five characters of `chchcc'. But grep (and other programs using regexp) writes on echo somepattern | grep -Ee 'some[^[.pattern.]]': Invalid collation character. What's wrong? ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: regexp [. .]
On 1/16/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I need to use regular expressions with a sequence of characters as a collating element. From re_format(7): Within a bracket expression, a collating element (a character, a multi- character sequence that collates as if it were a single character, or a collating-sequence name for either) enclosed in `[.' and `.]' stands for the sequence of characters of that collating element. The sequence is a single element of the bracket expression's list. A bracket expression containing a multi-character collating element can thus match more than one character, e.g. if the collating sequence includes a `ch' collating element, then the RE `[[.ch.]]*c' matches the first five characters of `chchcc'. But grep (and other programs using regexp) writes on echo somepattern | grep -Ee 'some[^[.pattern.]]': Invalid collation character. What's wrong? After some searching around I found the following post (albeit for a different project): http://permalink.gmane.org/gmane.comp.gnu.utils.bugs/11462 An excerpt: I have to admit to having no experience with collating characters. That said, I'll convey my understanding of them. You cannot use [. and .] to group an arbitrary pair of characters together. Collating characters are defined by the locale in which you're running, and only those defined by the locale are available for use inside [. and .]. They usually have names, defined by the locale; the name may or may not be the actual sequence of characters, such [as] '[.ch.].' I'm not sure, myself, but I hope that helps and isn't far from the truth ;) If anyone knows otherwise, please let me know. Is there a certain match you are trying to pattern? From the looks of it, [ch]* would match a similar set of characters, but it isn't as strict about which pattern they should be in. Sincerely, -Parker ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]