# Company Name - Reg ex pattern

**URL:** <http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072>\
**Category:** API Question\
**Created:** [November 13, 2018, 4:46pm UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072 "2018-11-13T16:46:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhupal\_patil](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@bhupal\_patil](http://forum.companieshouse.gov.uk/u/bhupal_patil)\
**Post date:** [November 13, 2018, 4:46pm UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/1 "2018-11-13T16:46:11Z")

</div>

Hi there,

Is there any reg ex pattern we need to follow to validate the company name before we trigger search?

I see company names are more of mix of special characters however just concerned if we add XML tag or some character with different format (different language…)

Thanks.

---

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [November 14, 2018, 10:02am UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/2 "2018-11-14T10:02:39Z")

</div>

The Companies House [XML Gateway](https://xmlgw.companieshouse.gov.uk/) lists data formats in their data schema (these are available from [Companies House XML Gateway Input - Schema Status](https://xmlgw.companieshouse.gov.uk/v1-0/xmlgw/SchemaStatusOutput)) for at:  
[http://xmlgw.companieshouse.gov.uk/v1-0/schema/chbase-v2-5.xsd](http://xmlgw.companieshouse.gov.uk/v1-0/schema/chbase-v2-5.xsd)

The Registered Company Name - minLength 1, maxLength 160

They capitalise company names (see [http://forum.aws.chdev.org/t/formatting-of-company-names-using-all-caps/2051](http://forum.aws.chdev.org/t/formatting-of-company-names-using-all-caps/2051)), but I believe search is case-insensitive here. In theory they’d normalise spacing e.g. convert multiple spaces to single but it seems this is not the case ([http://forum.aws.chdev.org/t/names-with-double-spaces/1539](http://forum.aws.chdev.org/t/names-with-double-spaces/1539)). I don’t know if the matching algorithm ignores number of spaces but suspect so.

> company names are more of mix of special characters

Do you mean that they allow characters from the unicode range? Here’s an example:

FC011780 - this is COÖPERATIEVE RABOBANK U.A.

> however just concerned if we add XML tag or some character with different format (different language…)

I’m not sure what you’re asking - the JSON input to search in the API is in the UTF-8 character set. The search seems to be reasonably sensible e.g. searching for “Cooperatieve Rabobank” (without umlaut o) brings up the company FC011780 above as the first item. I don’t know how far you can take this - but then I believe most company names are registered using standard ASCII characters.

I don’t know what you’re referring to with the “XML tag” part. Is that something to do with the XML gateway? If so then maybe try posting to [that forum](http://xmlforum.aws.chdev.org/).

---

<div class="post-metadata">

**Author:** ![bhupal\_patil](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/b/bc79bd/32.png) [@bhupal\_patil](http://forum.companieshouse.gov.uk/u/bhupal_patil)\
**Post date:** [November 14, 2018, 12:15pm UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/3 "2018-11-14T12:15:31Z")

</div>

Hi, Thanks for the reply.

reg xml tags, I meant, can the company name be like “ABC \<xyz\>PQR123\</xyz\> PLC”.

---

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [November 14, 2018, 4:10pm UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/4 "2018-11-14T16:10:12Z")

</div>

Ah, understand. You’re issuing a “GET” so the company name when you search should be [url encoded](https://en.wikipedia.org/wiki/Percent-encoding). So special characters you input would be as per that. I don’t know how CH would interpret e.g. UTF-8 characters. You can always test e.g. get your browser / javascript to send something! My previous:

> [@voracityemail](#):
>
> …the JSON input…

…wasn’t correct e.g. here you’re not sending in JSON, it’s url-encoded strings.

As to what data you may get **out** , the UTF-8 / JSON comment stands. As to odd characters which are present in company names, here’s a selection I’ve encountered:

&, quotes, dashes, punctuation, dots  
07881928 - &OFFICES CANARY WHARF LIMITED  
FC004087 - “EL AL” ISRAEL AIRLINES LIMITED  
02464812 - LLOYD’S OF LONDON (CASSIDY MEMBERS) NOMINEES LIMITED  
08013348 - .CO LTD  
08209882 - @ LTD  
10449726 - — LTD  
08209948 - ! LTD  
05063820 - ? LTD  
05062633 - \* LTD  
03237285 - … IN FOR A £ LIMITED  
11641085 - RS.SAI LIMITED

Some companies are clearly tests - you are escaping characters, right?

05060411 - \ COMPANY LTD  
08804157 - SAFDASD & SFSAF ' SFDAASF" LTD

…especially for your database:

10219186 - - LTD  
10542519 - ; DROP TABLE “COMPANIES”;-- LTD

Apparently there were some “long” names (although no examples are given) - but 160 characters is the limit you get back anyway:

[http://forum.aws.chdev.org/t/max-text-length-for-a-company-name/794](http://forum.aws.chdev.org/t/max-text-length-for-a-company-name/794)

There were some issues with odd characters in names but now fixed:

[http://forum.aws.chdev.org/t/odd-issue-with-matches-title-offset-in-company-search/187](http://forum.aws.chdev.org/t/odd-issue-with-matches-title-offset-in-company-search/187)

Double spaces in names:  
[http://forum.aws.chdev.org/t/names-with-double-spaces/1539](http://forum.aws.chdev.org/t/names-with-double-spaces/1539)

Other notes and queries:

Partnerships can be dissolved and then return with the **same** name:

[http://forum.aws.chdev.org/t/multiple-companies-with-the-same-name/498](http://forum.aws.chdev.org/t/multiple-companies-with-the-same-name/498)

Plus a few historical exceptions which will remain as duplicates:

[http://forum.aws.chdev.org/t/duplicate-names-for-active-england-wales-companies/1049](http://forum.aws.chdev.org/t/duplicate-names-for-active-england-wales-companies/1049)

P.S. it seems this question was asked before but not answered:

[http://forum.aws.chdev.org/t/is-there-an-official-regular-expression-for-company-names/1382](http://forum.aws.chdev.org/t/is-there-an-official-regular-expression-for-company-names/1382)

---

<div class="post-metadata">

**Author:** ![alex\_skene](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/a/df705f/32.png) [@alex\_skene](http://forum.companieshouse.gov.uk/u/alex_skene)\
**Post date:** [November 15, 2018, 11:00am UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/5 "2018-11-15T11:00:52Z")

</div>

This is the legislation covering allowable characters:  
[http://www.legislation.gov.uk/uksi/2009/1085/made](http://www.legislation.gov.uk/uksi/2009/1085/made)

I never knew these were called “solidus”: ` \ /`

Some more quirky names:  
`11363219 ;` (they have exemption from use of Limited in name)  
`07846401 AUS %U2013 SERVICE LIMITED` - did someone urlencode the n-dash by mistake when incorporating it?  
`11338331 COCO &AMP;AMP; ROX LIMITED` - more encoding issues?

We’ve not found any emoji-names yet, probably only a matter of time…

> **[Search Companies House](https://find-and-update.company-information.service.gov.uk/search?q=%F0%9F%98%80)**

---

<div class="post-metadata">

**Author:** ![dmw](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@dmw](http://forum.companieshouse.gov.uk/u/dmw)\
**Post date:** [November 15, 2018, 11:30am UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/6 "2018-11-15T11:30:32Z")

</div>

Here’s a list of ampersand problems that we have found:  
 ![](http://discourselive.s3-eu-west-1.amazonaws.com/original/1X/a5378c59329e5ec97ef38fe9eeb2099512dbb45d.png)

---

<div class="post-metadata">

**Author:** ![dmw](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/d/e274bd/32.png) [@dmw](http://forum.companieshouse.gov.uk/u/dmw)\
**Post date:** [November 15, 2018, 11:45am UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/7 "2018-11-15T11:45:54Z")

</div>

And a few more with other marks: quotation, plus, apostrophe:

 ![](http://discourselive.s3-eu-west-1.amazonaws.com/original/1X/25e5a7a6b67cfe66c1028de1e4a2ee22746d114b.png)

---

<div class="post-metadata">

**Author:** ![ash](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/a/f19dbf/32.png) [@ash](http://forum.companieshouse.gov.uk/u/ash)\
**Post date:** [November 15, 2018, 2:18pm UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/8 "2018-11-15T14:18:16Z")

</div>

> [@alex\_skene](#):
>
> This is the legislation covering allowable characters:  
> [The Company and Business Names (Miscellaneous Provisions) Regulations 2009](http://www.legislation.gov.uk/uksi/2009/1085/made)
> 
> I never knew these were called “solidus”: ` \ /`
> 
> Some more quirky names:  
> `11363219 ;` (they have exemption from use of Limited in name)  
> `07846401 AUS %U2013 SERVICE LIMITED` - did someone urlencode the n-dash by mistake when incorporating it?  
> `11338331 COCO &AMP;AMP; ROX LIMITED` - more encoding issues?
> 
> We’ve not found any emoji-names yet, probably only a matter of time…  
> [No search results - Find and update company information - GOV.UK](https://beta.companieshouse.gov.uk/search?q=%F0%9F%98%80)

Wondering how the people at ; (formerly ; LIMITED) pronounce their company name and could only think of:

[![](https://img.youtube.com/vi/hNoS2BU6bbQ/hqdefault.jpg "Funny Hugh Laurie & Stephen Fry comedy sketch! 'Your name, sir?' - BBC") ](https://www.youtube.com/watch?v=hNoS2BU6bbQ)

---

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [November 16, 2018, 12:17pm UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/9 "2018-11-16T12:17:53Z")

</div>

Nobody’s perfect. Search result _looks_ OK :

 ![](http://discourselive.s3-eu-west-1.amazonaws.com/original/1X/4e4374135875b3b9d8fffecceed22f71542f66bf.png)  
…but (how it appears in the API data too, including search):  
 ![](http://discourselive.s3-eu-west-1.amazonaws.com/original/1X/7b8ee907d1894302bd1f79efa8a2da9fac4a65e4.png)

I’ll let them know…  
Chris

---

<div class="post-metadata">

**Author:** ![voracityemail](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/v/b77776/32.png) [@voracityemail](http://forum.companieshouse.gov.uk/u/voracityemail)\
**Post date:** [November 16, 2018, 1:57pm UTC](http://forum.companieshouse.gov.uk/t/company-name-reg-ex-pattern/2072/10 "2018-11-16T13:57:43Z")

</div>

Just as a by-the-way some of the companies listed by @dmw will not be found in the API as they’ve been dissolved more than 6 years ago (you can see them in webCHeck).
