Jump to content

Regular Expression Anomaly #1: ^ character

Recommended Posts

Experimenting with regular expression Find/Replace, I discovered an anomaly using the ^ character, which should match the beginning of a line.

I started with this text:


and did a search for a very simple regular expression: just the ^ character and nothing else.

From my previous regex experience, this should match:

  1. Before the first paragraph break
  2. Before O in Off
  3. Before R in Riding
  4. Before i in into

Instead, based on the resulting cursor position in each case, it matched:

  1. Before the first paragraph break
  2. Again, before the first paragraph break
  3. Before the second paragraph break
  4. Before the line break
  5. Before the last paragraph break (but in the find results, it was after the last paragraph break)






-- Walt

Windows 10 Home, version 1909 (183623.476),
   Desktop: 16GB memory, Intel Core i7-6700K @ 4.00GHz, GeForce GTX 970
   Laptop:  8GB memory, Intel Core i7-3625QM @ 2.30GHz, Intel HD Graphics 4000 or NVIDIA GeForce GT 630M
Affinity Photo and Beta   / Affinity Designer and Beta  / Affinity Publisher and Beta

Share this post

Link to post
Share on other sites

Hi Walt,

Apologies for the delay in our response!

This seems to be alright for me in 1.7.2, unless my expectations are wrong?

I've attached a replace a did on the occurrences it found.


Serif Europe Ltd. - www.serif.com

Share this post

Link to post
Share on other sites

The insertion point is indeed in the correct place (which can be noticed if you just click Find and subsequently type in a character), but it is displayed as if it were at the end of the line (and before the break symbol). One might expect to see it blinking in the beginning of the line (?).

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Please note the Annual Company Closure section in the Terms of Use. These are the Terms of Use you will be asked to agree to if you join the forum. | 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.