# Inconsistent spaces around tags

**URL:** <https://forum.xbench.net/t/inconsistent-spaces-around-tags/479>\
**Category:** Technical Support\
**Created:** [March 27, 2019, 3:32pm UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479 "2019-03-27T15:32:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Phillips](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/christopher_phillips/32/160_2.png) [@Christopher\_Phillips](https://forum.xbench.net/u/Christopher_Phillips)\
**Post date:** [March 27, 2019, 3:32pm UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479/1 "2019-03-27T15:32:51Z")

</div>

Is it possible to check inconsistent spacing around tags?  
Does’t anyone have any checklists that help at all they can share?

Chris

---

<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:** [March 28, 2019, 8:56am UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479/2 "2019-03-28T08:56:20Z")

</div>

Hi Chris,

You can check inconsistent spacing around tags with the following searches:

1. Inconsistent spacing before tags:  
Source: `"([:space:]+\<[^\>]+\>)=1"`  
Target: `-@1`  
Search mode: Regular Expressions  
PowerSearch: On. (Press Ctrl+P)

2. Inconsistent spacing after tags:  
Source: `"(\<[^\>]+\>[:space:]+)=1"`  
Target: `-@1`  
Search mode: Regular Expressions  
PowerSearch: On. (Press Ctrl+P)

Best regards,  
Oscar.

---

<div class="post-metadata">

**Author:** ![Christopher\_Phillips](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/christopher_phillips/32/160_2.png) [@Christopher\_Phillips](https://forum.xbench.net/u/Christopher_Phillips)\
**Post date:** [March 28, 2019, 7:30pm UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479/3 "2019-03-28T19:30:16Z")

</div>

Thanks for the help. However, now I see this won’t work as the spacing we have been having issues with are link tags but in a segment there would be a space and no space around a tag so we will get FPs for every segment with tags

![image.png](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/xbench/original/1X/b5557b536a54e3fc4935041ae5732053dd4959c5.png)

---

<div class="post-metadata">

**Author:** ![Christopher\_Phillips](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/christopher_phillips/32/160_2.png) [@Christopher\_Phillips](https://forum.xbench.net/u/Christopher_Phillips)\
**Post date:** [March 28, 2019, 7:35pm UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479/4 "2019-03-28T19:35:35Z")

</div>

Could it be controlled just for the

**a href** and **/a**  
tags?

---

<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:** [March 29, 2019, 8:49am UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479/5 "2019-03-29T08:49:49Z")

</div>

The following search would check if the target matches the number of spaces before or after the tag:

Source: `"(\</a\>[:space:]+)=1" OR "([:space:]+\</a\>)=2"`  
Target: `-@1 OR @2`  
Search mode: Regular Expressions  
PowerSearch: On.

The following search would apply to check the \<a href tag:  
Source: `"\<a href" ("(\<a href[^\>]+\>[:space:]+)=1" OR "([:space:]+\<a href[^\>]+\>)=2")`  
Target: `-@1 OR @2`  
Search mode: Regular Expressions  
PowerSearch: On.

If checking the number of spaces is not required, replace `[:space:]+` with `[:space:]`.

---

<div class="post-metadata">

**Author:** ![Christopher\_Phillips](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/christopher_phillips/32/160_2.png) [@Christopher\_Phillips](https://forum.xbench.net/u/Christopher_Phillips)\
**Post date:** [March 29, 2019, 8:16pm UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479/6 "2019-03-29T20:16:34Z")

</div>

It is still showing FP

![image.png](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/xbench/original/1X/9207f6ab267921219b613dbc136a78045bc750bf.png)

---

<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:** [April 2, 2019, 2:07pm UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479/7 "2019-04-02T14:07:57Z")

</div>

Could you please [contact support](https://www.xbench.net/index.php/support/submit-bug) to submit a bug so that we can further investigate this issue?  
Please attach a sample file containing strings that are displayed as false positives.

---

<div class="post-metadata">

**Author:** ![Manuel](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/manuel/32/163_2.png) [@Manuel](https://forum.xbench.net/u/Manuel)\
**Post date:** [April 9, 2019, 6:26pm UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479/8 "2019-04-09T18:26:08Z")

</div>

Hi Chris,

Probably a bit too late for your issue, but the thing is, the main reasons why I conceive this inconsistent spacing might be an actual issue are:

1. The presence of double spaces (e.g.: one before and another after a tag).
2. The absence of a space before and after a tag (resulting in two words stuck together).

In both cases, both issues can (or, better said, should) be detected if you check the `Ignore Tags` checkbox in QA window. This way, double spaces should be detected by Xbench and the absence of the prescriptive space should be spotted by spellchecker (IMHO, in most cases no correctly spelled word will result from two random words stuck together).

Actually, perhaps it’s because of the checks I usually run, but I honestly think the `Ignore Tags` checkbox should be checked by default (`Tag mismatch` issue will still be detected with that checkbox activated, so I believe there are very few reasons to leave it unchecked).

The other reason one might want to check an inconsistent spacing is that the anchor tag pair changes formatting in final file (basically, through underlining or font change), and having an underlined space would look bad.

If that’s the case, I guess your problem is not so much having inconsistent spacing, but rather having spaces immediately after the first tag and/or immediately before the second tag of the tag pair (i.e.: something like “`Some text <1st tag> blablah <2nd tag> some more text`”).

If that’s the case, and assuming your problem is only with “a href” tag pairs, I would change the approach of the check and suggest the following:

_Target:_ `\<a href[^\>]+\>[:space:]|[:space:]\</a\>`  
_Search mode:_ Regular Expressions  
`Ignore Tags:` OFF

This way, you should find all strings with a space after the opening anchor tag and/or with a space before the closing anchor tag.

If, for whatever reason, you still want the `Ignore Tags` checkbox unchecked and want to check also the absence of spaces around such tags, you can perform the following check:

_Target:_ `\<a href[^\>]+\>[:space:]|[:space:]\</a\>|[:alpha:]\<a href[^\>]+\>[:alpha:]|[:alpha:]\</a\>[:alpha:]`  
_Search mode:_ Regular Expressions  
`Ignore Tags:` OFF

Hope it helped!

Kind regards,

Manuel

---

<div class="post-metadata">

**Author:** ![Christopher\_Phillips](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.xbench.net/christopher_phillips/32/160_2.png) [@Christopher\_Phillips](https://forum.xbench.net/u/Christopher_Phillips)\
**Post date:** [April 10, 2019, 9:50am UTC](https://forum.xbench.net/t/inconsistent-spaces-around-tags/479/9 "2019-04-10T09:50:48Z")

</div>

Thanks Manuel, that is an interesting approach thanks. I caught a missing space in the spell checker straight away.
