# Regular Expression in countColumn method

**URL:** <https://discuss.codemirror.net/t/regular-expression-in-countcolumn-method/2282>\
**Category:** Uncategorized\
**Created:** [February 1, 2020, 5:24pm UTC](https://discuss.codemirror.net/t/regular-expression-in-countcolumn-method/2282 "2020-02-01T17:24:25Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![suino](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/suino/32/706_2.png) [@suino](https://discuss.codemirror.net/u/suino)\
**Post date:** [February 1, 2020, 5:24pm UTC](https://discuss.codemirror.net/t/regular-expression-in-countcolumn-method/2282/1 "2020-02-01T17:24:25Z")

</div>

`CountColumn()` method is mainly used to count number of text for indentation.  
Then indentation is only created by half-width space or tab.  
But regular expression in `countColumn()` method also counts _spaces_ other than half-width space or tab.

> <https://github.com/codemirror/CodeMirror/blob/master/src/util/misc.js#L18>

In my case:

I want to write `\u3000`（full-width space） on head of all lines when writing Japanese text.  
`\u3000` is included in `\s`.  
For the reason, CodeMirror indents next line for half-width space.  
However that I need is No-indent or Full-width space indent.

I suppose that appropriate regular expression is `/[^\u0020\u00a0\t]/`…

Is there any other way?

Thank you.

---

_[View the full topic](https://discuss.codemirror.net/t/regular-expression-in-countcolumn-method/2282)._
