Jump to content
You must now use your email address to sign in [click for more info] ×

\< and \> (start & end of word respectively) error


Recommended Posts

Using the expressions of \< and \> (start & end of word respectively) in the following text:

Hi
this
is test file
to carry out few regular expressions

Replace: \~

lists the find results in a weird way. Replace/inserting say a tilde character only works one at a time. Replace all inserts the tilde at the end of the text. It should insert the tilde either at the beginning/end of each word depending on what find string one uses.

Mike

Link to comment
Share on other sites

On 2/23/2019 at 1:44 AM, MikeW said:

Using the expressions of \< and \> (start & end of word respectively)

Mike, as far as I know, these are Microsoft extensions used by the Microsoft family of products and are not part of the ECMAScript Regular Expressions.

2017 27” iMac 4.2 GHz Quad-Core Intel Core i7 • Radeon Pr 580 8GB • 64GB • Ventura 13.6.4.

iPad Pro (10.5-inch) • 256GB • Version 16.4

Link to comment
Share on other sites

8 hours ago, Seneca said:

Mike, as far as I know, these are Microsoft extensions used by the Microsoft family of products and are not part of the ECMAScript Regular Expressions.

These operators are Perl operators. They are also/can be used in ID...but unless the use of these particular operators are fixed in later versions of ID, they are broken in ID CS6. There are a few Perl broken operators in CS6 and one should use a cheat-sheet or (better yet) Peter's newest GREP book to see what is permissible in ID.

Mike

Link to comment
Share on other sites

10 hours ago, MikeW said:

These operators are Perl operators.

Thanks.

It seems that Publisher employs Boost RE engine (library) with Perl extensions.

2017 27” iMac 4.2 GHz Quad-Core Intel Core i7 • Radeon Pr 580 8GB • 64GB • Ventura 13.6.4.

iPad Pro (10.5-inch) • 256GB • Version 16.4

Link to comment
Share on other sites

14 minutes ago, Seneca said:

It seems that Publisher employs Boost RE engine (library) with Perl extensions.

You're welcome. I dunno about the boost library in APub per se, but the Perl extensions are in it.

To be honest, other than experimenting, I've never used these operators solo. I've only used them with other operators. I was simply running through various single operators seeing how APub acted.

Generally, I also don't use GREP inside of ID or other layout applications anyway. Once in a blue moon, something has escaped my notice in my text editor where I do GREP on tagged text files. That's the only time I use GREP in the layout application because by the time I notice I likely have done other work in the layout application and don't want to start over.

Link to comment
Share on other sites

1 minute ago, MikeW said:

I dunno about the boost library in APub per se, but the Perl extensions are in it.

Well, I opened the libregex.dynlib to have a look and the word boost is there so it seems to me that they have employed boost C++ implementation.

It has the following conformances (taken from boost.regex 5.0.0 manual):

Standards Conformance

C++

Boost.Regex is intended to conform to the Technical Report on C++ Library Extensions.

ECMAScript / JavaScript

All of the ECMAScript regular expression syntax features are supported, except that:

The escape sequence \u matches any upper case character (the same as [[:upper:]]) rather than a Unicode escape sequence; use

\x{DDDD} for Unicode escape sequences.

Perl

Almost all Perl features are supported, except for:

(?{code}) Not implementable in a compiled strongly typed language.

(??{code}) Not implementable in a compiled strongly typed language.

(*VERB) The backtracking control verbs are not recognised or implemented at this time.

In addition the following features behave slightly differently from Perl:

^ $ \Z These recognise any line termination sequence, and not just \n: see the Unicode requirements below.

POSIX

All the POSIX basic and extended regular expression features are supported, except that:

No character collating names are recognized except those specified in the POSIX standard for the C locale, unless they are explicitly

registered with the traits class.

Character equivalence classes ( [[=a=]] etc) are probably buggy except on Win32. Implementing this feature requires knowledge of

the format of the string sort keys produced by the system; if you need this, and the default implementation doesn't work on your

platform, then you will need to supply a custom traits class.

Unicode

2017 27” iMac 4.2 GHz Quad-Core Intel Core i7 • Radeon Pr 580 8GB • 64GB • Ventura 13.6.4.

iPad Pro (10.5-inch) • 256GB • Version 16.4

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.