# BAQ Regex Syntax Help

**URL:** <https://www.epiusers.help/t/baq-regex-syntax-help/113844>\
**Category:** Kinetic ERP\
**Tags:** baq\
**Created:** [April 18, 2024, 3:45pm UTC](https://www.epiusers.help/t/baq-regex-syntax-help/113844 "2024-04-18T15:45:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoeEpicor](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@JoeEpicor](https://www.epiusers.help/u/JoeEpicor)\
**Post date:** [April 18, 2024, 3:45pm UTC](https://www.epiusers.help/t/baq-regex-syntax-help/113844/1 "2024-04-18T15:45:17Z")

</div>

I’m trying to create table criteria using regex, there’s a bunch of other things I’m trying to grab, like descriptions with PO # [PONum], PO#[PONum], PO [PONum], etc. because (unfortunately) the descriptions were entered by different people over several years and they’re not very consistent.

Usually I would use something like metacharacters, which work when using the grid filter, but this doesn’t seem to work for the table criteria. Ideally I could filter whole words with something like ‘\bPO\b’, but I can’t in this case.  
So far I’ve got two regex expressions, ’  
%PO[0-9][0-9][0-9][0-9][0-9]’ or ‘%PO%[#][0-9][0-9][0-9][0-9][0-9]’,  
but there are still some results left out and some results that shouldn’t be included (words like Power and Depot make it through).

I’d appreciate any feedback, I can’t seem to find out what “flavor” of regex BAQs want me to use. I believe BAQs use regex for T-SQL, but what syntax should I be following?

---

<div class="post-metadata">

**Author:** ![kananga](https://www.epiusers.help/user_avatar/www.epiusers.help/kananga/32/80812_2.png) [@kananga](https://www.epiusers.help/u/kananga)\
**Post date:** [April 18, 2024, 4:59pm UTC](https://www.epiusers.help/t/baq-regex-syntax-help/113844/2 "2024-04-18T16:59:17Z")

</div>

SQL Server doesn’t natively support regex. You’re stuck with `LIKE` syntax in SQL Server, which is pretty limited in relation to regex. That’s no complaint - in SQL flavors that include regex support in queries it can be a real boat anchor on query peformance.

> **[LIKE (Transact-SQL) - SQL Server](https://learn.microsoft.com/en-us/sql/t-sql/language-elements/like-transact-sql?view=sql-server-ver16)**
>
> Determines whether a specific character string matches a specified pattern.
