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

**URL:** <https://forum.xbench.net/t/start-of-line-doesnt-work-in-first-segment-of-a-file/566>\
**Category:** Technical Support\
**Created:** [January 23, 2020, 5:55pm UTC](https://forum.xbench.net/t/start-of-line-doesnt-work-in-first-segment-of-a-file/566 "2020-01-23T17:55:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![awijas](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/awijas/32/16_2.png) [@awijas](https://forum.xbench.net/u/awijas)\
**Post date:** [January 23, 2020, 5:55pm UTC](https://forum.xbench.net/t/start-of-line-doesnt-work-in-first-segment-of-a-file/566/1 "2020-01-23T17:55:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![omartin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/omartin/32/82_2.png) [@omartin](https://forum.xbench.net/u/omartin)\
**Post date:** [January 24, 2020, 11:42am UTC](https://forum.xbench.net/t/start-of-line-doesnt-work-in-first-segment-of-a-file/566/2 "2020-01-24T11:42:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![awijas](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/awijas/32/16_2.png) [@awijas](https://forum.xbench.net/u/awijas)\
**Post date:** [January 24, 2020, 11:58am UTC](https://forum.xbench.net/t/start-of-line-doesnt-work-in-first-segment-of-a-file/566/3 "2020-01-24T11:58:56Z")

</div>

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
3. ABCFGH  
then my search shows #3 but not #1.

---

<div class="post-metadata">

**Author:** ![omartin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/omartin/32/82_2.png) [@omartin](https://forum.xbench.net/u/omartin)\
**Post date:** [January 24, 2020, 2:04pm UTC](https://forum.xbench.net/t/start-of-line-doesnt-work-in-first-segment-of-a-file/566/4 "2020-01-24T14:04:36Z")

</div>

Please [contact support](https://www.xbench.net/index.php/support/submit-bug) to submit a bug report and attach a sample file so that the issue can be reproduced.

---

<div class="post-metadata">

**Author:** ![awijas](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/awijas/32/16_2.png) [@awijas](https://forum.xbench.net/u/awijas)\
**Post date:** [January 24, 2020, 3:16pm UTC](https://forum.xbench.net/t/start-of-line-doesnt-work-in-first-segment-of-a-file/566/5 "2020-01-24T15:16:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![omartin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/omartin/32/82_2.png) [@omartin](https://forum.xbench.net/u/omartin)\
**Post date:** [January 24, 2020, 3:36pm UTC](https://forum.xbench.net/t/start-of-line-doesnt-work-in-first-segment-of-a-file/566/6 "2020-01-24T15:36:47Z")

</div>

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.
