ApSIC Xbench Forum

Start-of-line ^ doesn't work in first segment of a file

For example, I’m looking for all segments starting with “ABC”.
It works, except when ABC is in the first segment of a file.
I tried
and some other options, but none seem to work.

It is not currently possible to check specifically the first segment of a file.

When you run a search, it checks the content of each segment. In Regex, ^ means start of segment.

^ABC will find any segments that start with ABC.

For instance, you cannot check if a segment ends with a dot and the following one does not start with an Uppercase.

The problem is that (when I use ^ABC) Xbench finds segments that start with ABC, but if the 1st segment in the file starts with ABC, it doesn’t find it.

E.g. if my file is:

  1. ABCDE
  2. ACE
    then my search shows #3 but not #1.

Please contact support to submit a bug report and attach a sample file so that the issue can be reproduced.

Thanks, I already submitted a bug report with samples (“Problem with looking for start of file”) 3 weeks ago, but I haven’t received any answer yet.

In the case of the sample file attached to your bug report, you need to replace ^ with ^[\xEFBBBF\xFEFF\xFFFE\x0000FEFF] to run any search only at the first segment.