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

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:

image.png.671f42b75108bd830dc55661dd06fd8a.png

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)

find-caret.png.306bbc34fb8b2352f43ead5cf850c986.png

 

 

find-caret.afpub

image.png

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • 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.