# Space before "mm"

**URL:** <https://forum.xbench.net/t/space-before-mm/943>\
**Category:** Technical Support\
**Created:** [October 24, 2022, 7:50am UTC](https://forum.xbench.net/t/space-before-mm/943 "2022-10-24T07:50:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ming\_Jin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/ming_jin/32/384_2.png) [@Ming\_Jin](https://forum.xbench.net/u/Ming_Jin)\
**Post date:** [October 24, 2022, 7:50am UTC](https://forum.xbench.net/t/space-before-mm/943/1 "2022-10-24T07:50:57Z")

</div>

Hello, used the following regular expression to check if a space is missing before “ **mm** ” in the following sentence, but it doesn’t work, please help me to see how to solve this problem.

![regular_expression](https://canada1.discourse-cdn.com/flex035/uploads/xbench/original/1X/5f7a328a84f9af6c4c1dd109a3bfc2a755f03155.png)

 ![Space_before_mm](https://canada1.discourse-cdn.com/flex035/uploads/xbench/original/1X/75b6c52abd24cab86bc9ac096f52ee901c701e51.png)

Thank you.

---

<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:** [October 24, 2022, 8:23am UTC](https://forum.xbench.net/t/space-before-mm/943/2 "2022-10-24T08:23:44Z")

</div>

To find segments containing space before mm, try the following search:

Target: `"[0-9]+[:space:]mm>"`  
Search mode: regular expressions  
PowerSearch: on

---

<div class="post-metadata">

**Author:** ![Ming\_Jin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/ming_jin/32/384_2.png) [@Ming\_Jin](https://forum.xbench.net/u/Ming_Jin)\
**Post date:** [October 24, 2022, 8:33am UTC](https://forum.xbench.net/t/space-before-mm/943/3 "2022-10-24T08:33:03Z")

</div>

Tried it, but it still didn’t work.  
 ![regular_expression1](https://canada1.discourse-cdn.com/flex035/uploads/xbench/original/1X/22d45b8b39d417ed0d52a6640bba11553c28a0c8.png)

---

<div class="post-metadata">

**Author:** ![pcondal](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/pcondal/32/305_2.png) [@pcondal](https://forum.xbench.net/u/pcondal)\
**Post date:** [October 24, 2022, 10:20pm UTC](https://forum.xbench.net/t/space-before-mm/943/4 "2022-10-24T22:20:43Z")

</div>

To find segments that **do not** have a space before mm, try the following search:

Target: `"[0-9]+mm>"`  
Search mode: regular expressions  
PowerSearch: on

---

<div class="post-metadata">

**Author:** ![Ming\_Jin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/ming_jin/32/384_2.png) [@Ming\_Jin](https://forum.xbench.net/u/Ming_Jin)\
**Post date:** [October 25, 2022, 12:43am UTC](https://forum.xbench.net/t/space-before-mm/943/5 "2022-10-25T00:43:15Z")

</div>

Yes, it works. Thank you.

---

<div class="post-metadata">

**Author:** ![Ming\_Jin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/ming_jin/32/384_2.png) [@Ming\_Jin](https://forum.xbench.net/u/Ming_Jin)\
**Post date:** [October 25, 2022, 12:57am UTC](https://forum.xbench.net/t/space-before-mm/943/6 "2022-10-25T00:57:59Z")

</div>

Another question, how to check if there are spaces between all numbers and units by a regular expression?

For Example:  
4.2 dm  
57 m  
34.54 cm  
35.9 mm  
87 dB  
…

---

<div class="post-metadata">

**Author:** ![pcondal](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/pcondal/32/305_2.png) [@pcondal](https://forum.xbench.net/u/pcondal)\
**Post date:** [October 25, 2022, 7:51pm UTC](https://forum.xbench.net/t/space-before-mm/943/7 "2022-10-25T19:51:48Z")

</div>

The following Regular Expression finds entries **that have ONE space** between the number and the unit in your list):

`[0-9][:space:](dm|m|cm|mm|dB)>`

The following Regular Expression finds entries **that DO NOT have spaces** between the number and the unit in your list):

`[0-9](dm|m|cm|mm|dB)>`

---

<div class="post-metadata">

**Author:** ![Ming\_Jin](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/ming_jin/32/384_2.png) [@Ming\_Jin](https://forum.xbench.net/u/Ming_Jin)\
**Post date:** [October 26, 2022, 12:49am UTC](https://forum.xbench.net/t/space-before-mm/943/8 "2022-10-26T00:49:29Z")

</div>

Seems not work, the error report is shown below

![Space_2](https://canada1.discourse-cdn.com/flex035/uploads/xbench/original/1X/7555c99012bfba5fdd59897f275429e7bf6c3743.png)

---

<div class="post-metadata">

**Author:** ![pcondal](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/pcondal/32/305_2.png) [@pcondal](https://forum.xbench.net/u/pcondal)\
**Post date:** [October 26, 2022, 1:06am UTC](https://forum.xbench.net/t/space-before-mm/943/9 "2022-10-26T01:06:24Z")

</div>

In this case you need to unselect Powersearch (it is not needed for this particular search).

If there are parentheses in the expression and you need use Powersearch, then you need to enclose expressions in straight double quotes so that Powersearch considers the whole expression as a unit.
