[Question]
  [
Given a list of digits 1 through 9, output whether each digit is grouped together as a single contiguous block. In other words, no two of the same digit are separated by different digits. It's OK if a digit doesn't appear at all. Fewest bytes wins.
**Input:** A non-empty list of digits 1 through 9. This can be as a decimal number, string, list, or similar sequence.
**Output:** A consistent [Truthy](https://codegolf.meta.stackexchange.com/questions/2190/interpretation-of-truthy-falsey) value if all the digits are grouped in contiguous blocks, and a consistent [Falsey](https://codegolf.meta.stackexchange.com/questions/2190/interpretation-of-truthy-falsey) value if they are not.
True cases:
```
3
51
44999911
123456789
222222222222222222222
```
False cases:
```
818
8884443334
4545
554553
1234567891
```
```
var QUESTION_ID=77608,OVERRIDE_USER=20260;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/77608/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```
```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}
```
```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```
  
[Answer]
# Python 3, ~~38~~ ~~34~~ 33 bytes
```
lambda s:s==sorted(s,key=s.index)
```
This expects a list of digits or singleton strings as argument. Test it on [Ideone](http://ideone.com/lPtREK).
*Thanks to @xsot for golfing off 4 bytes!*
*Thanks to @immibis for golfing off 1 byte!*
[Answer]
## JavaScript (ES6), 27 bytes
```
s=>!/(.)(?!\1).*\1/.test(s)
```
Uses negative lookahead to look for two non-contiguous digits. If at least two such digits exist, then they can be chosen so that the first digit precedes a different digit.
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), 4 bytes
Code:
```
√î¬π√ôQ
```
Explanation:
```
√î     # Push connected uniquified input. E.g. 111223345565 would give 1234565.
 ¬π    # Push input again.
  √ô   # Uniquify the input. E.g. 111223345565 would give 123456.
   Q  # Check if equal, which yields 1 or 0.
```
Uses **CP-1252** encoding.
[Try it online!](http://05ab1e.tryitonline.net/#code=w5TCucOZUQ&input=NDQ5OTk5MTE)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
ƒ†IFP·ªä
```
[Try it online!](http://jelly.tryitonline.net/#code=xKBJRlDhu4o&input=&args=NDQ5OTk5MTE)
### How it works
```
ƒ†IFP·ªä  Main link. Input: n (list of digits or integer)
ƒ†      Group the indices of n by their corresponding values, in ascending order.
       For 8884443334, this yields [[7, 8, 9], [4, 5, 6, 10], [1, 2, 3]].
 I     Increments; compute the all differences of consecutive numbers.
       For 8884443334, this yields [[1, 1], [1, 1, 4], [1, 1]].
  F    Flatten the resulting 2D list of increments.
   P   Product; multiply all increments.
    ·ªä  Insignificant; check if the product's absolute value is 1 or smaller.
```
[Answer]
# Pyth, ~~6~~ 5 bytes
*1 bytes thanks to FryAmTheEggman*
```
SIxLQ
```
Inspired by the Python solution [here](https://codegolf.stackexchange.com/a/77624/20080).
[Test suite](https://pyth.herokuapp.com/?code=SIxL&input=%22888444333%22&debug=0)
**Explanation:**
```
SIxLQ
  xLQ   Map each element in the input to its index in the input. Input is implicit.
SI      Check whether this list is sorted.
```
[Answer]
# R, ~~66~~ ~~48~~ ~~46~~ ~~43~~ 38 bytes
```
function(s)!any(duplicated(rle(s)$v))
```
This is a function that accepts the input as a vector of digits and returns a boolean. To call it, assign it to a variable.
Not the shortest but I thought it was a fun approach. We run length encode the input and extract the values. If the list of values contains duplicates then return `FALSE`, otherwise return `TRUE`.
[Verify all test cases online](http://www.r-fiddle.org/#/fiddle?id=R8cXhmZ0&version=5)
Saved 20 bytes thanks to MickyT, 3 thanks to Albert Masclans, and 5 thanks to mnel!
[Answer]
# [MATL](https://github.com/lmendo/MATL), 8 bytes
```
t!=tXSP=
```
The output is an array containing only ones for truthy, or an array containing at least one zero for falsey.
[**Try it online!**](http://matl.tryitonline.net/#code=dCE9dFhTUD0&input=Jzg4NDQ0MzMzJw)
### Explanation
Consider the input `22331`, which satisfies the condition. Testing if each character equals each other gives the 2D array
```
1 1 0 0 0
1 1 0 0 0
0 0 1 1 0
0 0 1 1 0
0 0 0 0 1
```
The final result should be truthy if *the rows of that array (with rows considered as atomic) are in decreasing lexicographical order*. For comparison, input `22321` gives the array
```
1 1 0 1 0
1 1 0 1 0
0 0 1 0 0
1 1 0 1 0
0 0 0 0 1
```
in which the rows are not in order.
```
t!   % Take string input. Duplicate and tranpose
=    % Test for equality, element-wise with broadcast: gives a 2D array
     % that contains 0 or 1, for all pairs of characters in the input
t    % Duplicate
XS   % Sort rows (as atomic) in increasing order
P    % Flip vertically to obtain decreasing order
=    % Test for equality, element-wise
```
[Answer]
## [Retina](https://github.com/mbuettner/retina), 17 bytes
```
M`(.)(?!\1).+\1
0
```
[Try it online!](http://retina.tryitonline.net/#code=JShHYApNYCguKSg_IVwxKS4rXDEKTWAwCilHYA&input=Mwo1MQo0NDk5OTkxMQoxMjM0NTY3ODkKMjIyMjIyMjIyMjIyMjIyMjIyMjIyCjgxOAo4ODg0NDQzMzM0CjQ1NDUKNTU0NTUzCjEyMzQ1Njc4OTEKMTIxMjM0MzQzNDQ1NDU0NTY3Njc4OTg5) (Slightly modified to run all test cases at once.)
The first regex matches digits which *are* separated by other digits, so we get a `0` for valid inputs and anywhere between `1` and `9` for invalid inputs (due to the greediness of the the `.+`, we can't get more than `n-1` matches for `n` different digits).
To invert the truthiness of the result, we count the number of `0`s, which is `1` for valid inputs and `0` for invalid ones.
[Answer]
# J, 8 bytes
```
-:]/:i.~
```
Test it with [J.js](https://a296a8f7c5110b2ece73921ddc2abbaaa3c90d10.googledrive.com/host/0B3cbLoy-_9Dbb0NaSk9MRGE5UEU/index.html#code=(%20-%3A%5D%2F%3Ai.~%20)%204%204%209%209%209%209%201%201).
### How it works
```
-:]/:i.~  Monadic verb. Argument: y (list of digits)
     i.~  Find the index in y of each d in y.
  ]/:     Sort y by the indices.
-:        Match; compare the reordering with the original y.
```
[Answer]
## Java, 161 156 bytes
[Because Java...](http://meta.codegolf.stackexchange.com/a/5829/16043)
Shamelessly stealing borrowing the regex from [this answer](https://codegolf.stackexchange.com/a/77634/16043) because I started out trying to do this with arrays and math manipulation, but it got hideously complex, and regex is as good a tool as any for this problem. 
```
import java.util.regex.*;public class a{public static void main(String[] a){System.out.println(!Pattern.compile("(.)(?!\\1).*\\1").matcher(a[0]).find());}}
```
Ungolfed:
```
import java.util.regex.*;
public class a {
    public static void main(String[] args) {
        System.out.println(!Pattern.compile("(.)(?!\\1).*\\1").matcher(args[0]).find());
    }
```
Laid out like a sensible Java person:
```
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class  {
    public static void main(String[] args) {
        Pattern p = Pattern.compile("(.)(?!\\1).*\\1");
        Matcher m = p.matcher(args[0]);
        System.out.println(!m.find());
    }
}
```
[Answer]
# Regex (Perl / PCRE / Java / Boost / Python[`regex`](https://bitbucket.org/mrabarnett/mrab-regex/src/hg/) / Ruby), 17 bytes
```
^(?!(.)+\1*+.+\1)
```
[Try it online!](https://tio.run/##bY1NT8JAEIbv8ytGuqFdQcrSXS1dSkOCHj1xJG4qKUmTteAWDqapf71OMagH5zCfz/vOsXBWdW8fyJzGxh52uUUWahrTxXq1WS1b2B9cwMp0qhdLTVXwBss9bXhzdGV1wsG2GugWmcUU6/NrfSLcjO/EWPDivT9i9mc/pQvHBJnRgGSEAQmHwx/CEiF4Vfief30Q9Ej6iSFzYckzf@PORYLoJ/5Tbmtqfa5bMvummdXYGvP4vDamewmym2DCR1txO5pQ5l3nYa/HXV4XNUAESoCUcwohQMwiqe4f4jnM/gsADy8vr@pYxBDHsZQyiiIJUkkFipKKfq3EFw "Perl 5 ‚Äì Try It Online") - Perl  
[Try it online!](https://tio.run/##bZBRS8MwEMff8yluWbGJ1m2xqdbF0henCKJSfbMaaslsIdtK0j2Jn31eJyKIBzkul//97i5d0@0u8q7pIHCQAZ1SmEDnzLt2prNVbVg4nRzmWjeV7XW9WXWtNa5kJVdlMfVhBCGeJSb1uxkE696se8@0vrq5XWjNIxAckXS6bakiy41jQZvNVGCzJRZ49vh0eXPHFf@AdskC@@x7Z80aI34sXrKMlmvKUey3b/iC6WgWHQuu9uqWm7rZDBIFSBWKAOaB/TIODhA5exll4TjEFsEq2@@2qvq6YYGLUKJggHzvbCvfa@McTslH2UOxuNZ393pRFPdFThdDfg50zoJVTp/c1swBb/Sqsh5DiqRPHGBPo4Gl6vPPrzGudq8sH7EJPyrF4dEEPd/txjCwoK688YTEJBFEynM0IYg4iWVyepaek5P/jJAx7Nv/VKciJWmaSinjOJZEJjIhCbok/kWJLw "PHP ‚Äì Try It Online") - PCRE  
[Try it online!](https://tio.run/##bZJbb9owFIDf/SsOQSo2dC4pYaONsqqbqIS0omlUe1m3ySQOmDoOi53ChPjt7ATCtm74wfG5feeWhXgWrxbJ005ly7xwsECZq5y3Q/hbUzqlT@oKOZPryrIsp1rFEGthLdwLZWBTq6wTDj/PuUogQwOduEKZGYhiZr98ZeDmRb6yMFzHculUjoEE4E5pCWlk5Gr/pB6P80RytHssfFemqSxk8kmKRBYw3bu9VNJjZC2mjIV1XnvuwtW84lNqoym2IJIPykjKWCMypdZMpdRy@aMU2lLvot1ue4xtXroeCJS6k4ANEtxvAgIukDBFv6fQdqLWo2lVXxduD7rtR@GcLAwUUf3CbrNllcCeHzXvbyfD76PxZDiejB5Gn4csxDFNYmEMjkCZZekggqrrWkcnP62TGVeG4d6MAxV1Q6gb3/vzubBjuXZYN2wAS1aNqMvqsBztS5yX04ZWgMiv8mHGwxA1JjtADBLqmSADqOZampmbU/a2C2dnoHk8F8Wto12cTqvZYvv9VudeuHiOxWfIKnh2kKhGzr81pDTjqTIJZXAD3kNRymsAD67Bu8MJo4A/xfa/qAq13W5JtcHdN3rToJx1Hv12h@PNdtVadk2oaBALKy0hPdL3SRBc4fF94l/2gv7rN4MrcnnqENKEffpj9MAfkMFgEARBr9cLSNAP@qSPV7/3B@X/Ag "Java (JDK) ‚Äì Try It Online") - Java  
[Try it online!](https://tio.run/##bVHBbtswDL3rK1gHaKTEyarY7lw7aYEe9gFDDy3SzHAVxTbm2IIkI2uK/PoySU7WdhgPhEg@8pFPTIhJwdhxUDWs7tYc5i9tq/QXyQv@a1oKcYtYmUvIxHIFC/ju3e92P1@C7un19fGhvN6V@PgD313gKRk/09F4ajw5kn9Bng8jscjEmKbonakyRJLn21tUNRqEND7jUrYSs7ZRGhzxaMuVygtO3pReJwkzAJjP4ZS1T5fnzbpOQXLdyQZoenAjt3nVYAJvCIyJpWGreYMFmdDV4iqFzmCCWaahtZFtKMzDgd1Mg6@awhREp1Pod3LqJImTx9Bh4X9KJUnFcsVJes6qba5ZCbsy1/3kTSsBW669JXU8Bdd11XDcH1g1fk9phuwX9Ly@tWoDeE/A1Kw0ePjcDEn6qeoal1cruLyE8/tiMRwMyV@Y08JqvcEfN88UzyUr@wm@W9g3BxK4A@9BdjwB8CAB71teKxN4H4g3O1lp3ndOWWZkw@R0w1RVe24j6ttbW3uV6zs4f/ovI/rhOABLA1Y@hVCAIorC8MYYpYjOgjC6/hrfoNn/DKEBuL3O3TGNURzHYRgGQRCiMAojFBkXBe@j6G@2qfNCHSe10yFzMvwB "C++ (gcc) ‚Äì Try It Online") - Boost  
[Try it online!](https://tio.run/##bY7BbsIwDEDv/gqTHtoOVjUk2UKmaLd9wW4FpIqGUSlLq6STBj/fJUyICz7YsuX37PE8nQbH5v57HPyE4RxW3nyZX/Co0RNC5n3xviiqcrmlT8sq5nKO04aqZ7p7w4uu4Th4tNi7BFdh6nqnALE/4kXh6Hs3FeV/b40rbImt69A2Edc637pcodW2qZPvwVq9W@g8y28m4zpNPv2PUYgkLV@frYJp/eFU@BVG0NhgkHy0sSgk6fadtWX6mc4ZJgke2mACAANBgfNNDEqBrhkXL69yA@tHAZDhVX6jJZUgpeScM8Y4cMEFiJgEu6voHw "Python 3 ‚Äì Try It Online") - Python `import regex`  
[Try it online!](https://tio.run/##bU1LT4NAGLzvrxiWpA@bblhYdFuyIU2qRw@mtxYJ6lpJVkIWSO3Fv44LtfHiHCaZbx6f7V7OvYXCkz7qr5pV@oTtZrdhVhdvCUoVJDh9lEbDqKNuGwKU7yi94V53bZNAV2OOJ4Nh9kueKUUPFU1cw@wDxpZhNqYuVc8w/Vm35xSTiYsHmaem/tR5QG3LqoWB@oZFCrqznV4DFGvQh8I0TtDr0m/2IvP8/nGb5/3zLPVmbL448JsFczzvex/DCl6LRjeERCTmRIiVA@eEh5GIb@/kioT/gRAf49trW3JJpJRCiCiKBBGxiEnsKI7@pvgP "Ruby ‚Äì Try It Online") - Ruby
```
^             # Anchor to start of string
(?!           # Assert that the following can't match:
    (.)+      # Skip any number of characters (minimum zero), then capture
              # the next character in \1
    \1*+      # Skip all subsequent occurrences of \1, and lock in that match
              # using a possessive quantifier.
    .+        # Skip at least one character, or as many as necessary to make the
              # following match:
    \1        # Match the character captured in \1
)
```
## Regex (Perl / PCRE / Java / Boost / Python[`regex`](https://bitbucket.org/mrabarnett/mrab-regex/src/hg/) / Ruby), 11 bytes
```
(.)\1*+.+\1
```
Returns a match for false, and a non-match for true.
[Try it online!](https://tio.run/##bY09b8IwEIb3@xUnYuG4UIKx3ZqYgJBox06MkawUBSmSG6gDQxWlfz01RbQdesN9Pu97x9I71b99IPEGW3fYFQ5JYsKYLTbr7XrZwf7gY1JlU7NYmlA5a7Hahw1rj76qTzjI64HpkDjMsDm/NqeA2/E9H3NWvl@OuPqzn4YLwxSJNYDBCOMgHA5/CBcIzuqSRvT2IL4g2ScmxCcVW9HnwjVlijSlW38ODVJmumB2pYkz2Fn79LKxto8nLOd3o8ko530f4YXHXdGUDYAAxUHKeQjOgc@EVA@Peg6z/wIgwu@3N7XmGrTWUkohhASppAIVkhK/VvwL "Perl 5 ‚Äì Try It Online") - Perl  
[Try it online!](https://tio.run/##bZBRS8MwEMff8ynOrNjE1W2xqVZj2YtTBHFS92Yl1JKthWwrSfck@@zzOhFBPEi4/PO/X@7S1u3hdtrWLQQOMqBjCiNonVlpZ1pbVoaF49HZVOu6tJ2utuu2scYVrOCqyMc@jCDEtURRr0xv2HRm03mm9f3j00xrHoHgiKTjXUMVWW4dC5psogKbLbHAs9fF3eMzV/wTmiUL7JvvnDUbzPi5eM8yWmwoR7PffeANytEkOhdcHd0NN1W97S0KkCoUAdSB/TJOTxE5eT/JwkGITwTr7DjbuuyqmgUuQouCHvI9sy19p41z2CU/yV7y2YN@nutZns/zKZ31@g3QGxasp/S@tN70J7pwO0yAImmPDRxpNLBU7f/8GuPqwEa8EGfD0bAQh8MA@lqoSm88ITFJBJHyGkMIIi5imVxepdfk4r8gZADHFn6qU5GSNE2llHEcSyITmZAEtyT@RYkv "PHP ‚Äì Try It Online") - PCRE  
[Try it online!](https://tio.run/##bZJbb9owFIDf/StOQSo2dC5pwpYuyqZuohLSiqZR7WVMk0kccOs4NHYKE@K3sxMI27phKbF9Lt@5@UE8i1cP6eNO5cuidPCAd64K3o3gb0nllD4pK@VcrmvNsppplUCihbVwJ5SBTSOyTjjcnguVQo4KOnGlMnMQ5dx@@87ALcpiZWG4TuTSqQIdCcCt0hKy2MjV/khbPClSyVHfYtGHKstkKdMvUqSyhNne7KWQHj2ba8ZY1MS1Fy5aLWo@pTaeYQki/aSMpIydxabSmqmMWi6fKqEtbV12u90WY5uXpgcCpe4kYIME95uAgEskzNDuMbK9uDM1nXp30fYg234WzsnSQBk3J6w2X9YB7MVR8vFmMvwxGk@G48nofvR1yCJs0yQRxmALlFlWDmKoq25kdPLTOplzZRjOzThQcT@CpvC9PV8IO5Zrh3nDBjBldRb3WeNWoH6J/XLa0BoQe3U8jHhoosZgB4hBQtMTZADVXEszdwvK3vXh/Bw0TxaivHG0j93ptDtsP9963QmXLDD5HFklzw83qpHzbw4ZzXmmTEoZvIfWLXZVvoUW4HdfVngEfBTb/7xq1Ha7JfUEd5Szqdft8d7U29UD2bWh9oVEWGkJ8cnAI0FwjcvziHflB4PXb8JrcnVqEdKGfRJH79ALSRiGQRD4vh@QYBAMyAB/A/8PyvsF "Java (JDK) ‚Äì Try It Online") - Java  
[Try it online!](https://tio.run/##bVFtb9owEP7uX3EDqdgQWE2SLk2gk/ZhP2Dqh02AotSYJFpwLNsRKxV/fcx2YG2nnZTT@V6e5@4Jk3JaMnYe1oI13ZbD4qlttfmoeMl/zSopHxCrCgW5XG1gCd8GXw6Hn09h9@P5@ftjdXeo8BnPyJqOJ7PJmp7Jv@VBAGO5zOWEZuiVo7YUihf7B1QLA1JZn3OlWoVZK7QBTznec62LkpMXbbZpymwDLBZwybrQ57nYNhkobjolgGYnD7kvaoEJvCCwJleWreECSzKlm@VtBp3tCee5gda93EBpA9/sMW1/LUpbkJ3JoN/J65KmXhhLh2XwLpWmNSs0J9k1q/eFYRUcqsL0yLtWAXZcR0fqeUpumlpw3B9Yi6CntCDHJb2u76zeAT4SsDUnDR6txYhk76p@cHW7gZsbuMYflqPhiPxt81o4rXf47ea55oViVY8Q@IUDeyCBzzD4WjSapzAA@z2qzoYweEO8O6ja8H5yxnIrGyaXG2a6PnL3ooG7tXVX@bmT95f/ZUU/nYfgoMHJpxEKUUxRFN1boxTReRjFd5@SezT/nyE0BL/jdTqhCUqSJIqiMAwjFMVRjGLr4vAViv5mu6Yo9XnaeB1yL8Mf "C++ (gcc) ‚Äì Try It Online") - Boost  
[Try it online!](https://tio.run/##bY7BboMwEETv@xVbcwCaFLGx3TpUvvYLeiM5oOA0SK5BNpWa/Dy1U0W5ZA8rrWbe7Ezn@TQ6vgzf0@hnDOew9ubL/IJHjZ4xthRVuaPnVbXa0RLvlpoX2r/jRddwHD1aHFzCqjD3g2sAcTjipcHJD24uyv/bGlfYEjvXo20jrnW@c3mDVtu2TnkPbPX@SedZfksyrtfso7PBNMiS@VqzCqbzh1Ph1xhBE1Vkn/4nepCl33fWlqkzLRkmHQ9dMAGAgyQQYhuHCGjDhXx9U1vYPBqADK8NbrQiBUopIQTnXICQQoKMS/J7FP0B "Python 3 ‚Äì Try It Online") - Python `import regex`  
[Try it online!](https://tio.run/##bU1NS8NAEL3vr3hJoFVLl2x2V7eGpRSqRw/SWxNC1LUG1hA2CbUX/3rcpBYvPphhZt7HuP7lNDhoPJuD@WpobY7YbnYb6kz5lqLScYrjR2UNrD6YriVA9Y4qGO9N37UpTD3pWDoSdr9kudZhVoepd9h9TOkyySfV2RpYaj6b7rTGbOblcR7oeTT3HNC4qu5gob/hsEb4WNrW3COEr53r/YjwkvSrPa9F8fC0LYrhil5n7GZBFxkbhgijB69la1pCOJGMCLHyYIywhAt5e6dWJPkPhESYnl/ciimilBJCcM4FEVJIIn2T/C@K/QA "Ruby ‚Äì Try It Online") - Ruby
This beats the regex in the previous [Java answer](https://codegolf.stackexchange.com/a/77657/17216), [Perl answer](https://codegolf.stackexchange.com/a/77684/17216), and [Ruby answer](https://codegolf.stackexchange.com/a/77634/17216) by 2 bytes.
```
(.)   # \1 = a character anywhere in the string
\1*+  # Skip all subsequent occurrences of \1, and lock in that match using a
      # possessive quantifier.
.+    # Skip at least one character, or as many as necessary to make the
      # following match:
\1    # Match the character captured in \1
```
## Regex (ECMAScript (or better) / Python / .NET), 13 bytes
```
(.)(?!\1).+\1
```
Returns a match for false, and a non-match for true.
**[Try it online!](https://tio.run/##bU3LbsIwELz7KxxFwrsUAiY2NUQup/YD2t5KD1Ew1K1JItv0QdVvTwMS6qVzGO1odmZey/cyVN62cRxauzF@39Rv5qvzujYf9N7sbj9bgKO@mQw7yBBWyZpjdrXm3XByxCw2D9HbegeYBWcrA/PRWOCIMsuw2DYerJ4W4LQ35cbZ2gBiouuDc4XVHL8JpXYLFtu@IwIWvXZ0MKDuafqcaJayk2gPMUQPLtuXsXoBjyt2V7pglpQt2aM/9Adl5@zlE4ufLqUni1ZlMIGQnEhOhFj04JzwWS7k/FotyOw/EJLS88IlrbgiSikhRJ7ngggpJJE9yfyviv8C "JavaScript (SpiderMonkey) ‚Äì Try It Online") - ECMAScript**  
[Try it online!](https://tio.run/##bY3PT8IwFMfv7694soauERmlrZaVQUjQoyeOS5pJRrKkDuzgYJb5r89Og3rwHd7Pz/f7TqV3qn99R@INtu64LxySxIQxW243u82qg8PRx6TKZma5MqFy1mJ1CBvWnnxVn3GU1yPTIXGYYXN5ac4Bt5M7PuGsfBuOuP6zn4ULwxSJNYDBCOMgHI9/CBcIzuqSRvT6IB6Q7AMT4pOKrelT4ZoyRZrSnb@EBikzXTD7pokz2Fn7@Ly1to@nLF7f5JxNb3Pe9xEOCtwXTdkACFAcpFyE4Bz4XEh1/6AXMP8vACL8enxVa65Bay2lFEJIkEoqUCEp8WvFPwE "Perl 5 ‚Äì Try It Online") - Perl  
[Try it online!](https://tio.run/##bZBRS8MwEMff8yluWbGJ1m2xqVZj6YtTBHFS92Yl1JLZQraVpHsSP/u8TkQQDxIu//zvl7t0Tbe/zrumg8BBBnRKYQKdM@/amc5WtWHhdHKca91Uttf1dt211riSlVyVxdSHEYS4VijqdzMYNr3Z9J5pfXv/MNeaRyA4Iul011JFVlvHgjabqcBmKyzw7Hl5c//IFf@AdsUC@@J7Z80GM34qXrOMlhvK0ex3b3iDcjSLTgVXB3fLTd1sB4sCpApFAHVgv4yjI0TOXkdZOA7xiWCdHWZbV33dsMBFaFEwQL5ntpXvtXEOu@Sj7KmY3@nHhZ4XxaLI6XzQr4BesWCd09vKejOc6NLtMAGKpE9s4ECjgaXq88@vMa72bMJZPioFn5yUYr8fw1ANdeWNJyQmiSBSXmIIQcRZLJPzi/SSnP0XhIzh0MRPdSpSkqaplDKOY0lkIhOS4JbEvyjxBQ "PHP ‚Äì Try It Online") - PCRE  
[Try it online!](https://tio.run/##bZJbb9owFIDf/StOQSo27VxSwpYuyqpuohLSiqal2suYJpM4YOo4LHYKE@K3sxMI27phKbF9Lt@5eSGexatF@rRT@bIoHSzwzlXBuyH8Lamc0idlpZzJda1ZVlOtEki0sBYehDKwaUTWCYfbc6FSyFFBY1cqMwNRzuzXbwzcvCxWFobrRC6dKtCRANwrLSGLjFztj7TFkyKVHPUtFr6vskyWMv0sRSpLmO7NXgrp0bO5ZoyFTVx76cLVvOZTaqMpliDSj8pIythZZCqtmcqo5fJHJbSlratut9tibPPS9ECg1J0EbJDgfhMQcIWEKdo9hfYi6kxMp95duD3Itp@Ec7I0UEbNCavNl3UAe3mUfLiLh99H43g4jkePoy9DFmKb4kQYgy1QZlk5iKCuupHR@Kd1MufKMJybcaCiXghN4Xt7Phd2LNcO84YNYMrqLOqxxq1A/RL75bShNSDy6ngY8dBEjcEOEIOEpifIAKq5lmbm5pS968H5OWiezEV552gPu9Npd9h@vvV6EC6ZY/I5skqeH25UI@ffHDKa80yZlDK4hdY9dlW@hRbg91hWeAR8FNv/vGrUdrsl9QR3lDN6ezbxGL@YeLt6JLs21N6QCCstIX0y8Ijv3@DyPOJd9/3B6zfBDbk@tQhpwz6No3fgBSQIAt/3@/2@T/yBPyAD/A36f1DeLw "Java (JDK) ‚Äì Try It Online") - Java  
[Try it online!](https://tio.run/##bVFtb9owEP7uX3EFqdhtYDVJujSBVtqH/YCpH1YBilJjEmvBsexErFT89THbgb5MOymn8708z90TptS4ZOw4FJLV3ZrD7LlpTPtF85L/nlRK3SNWFRpytVjBHH4Mvu12v57D7unl5edjdbur8BFPCH64WFIyuV7SI/m3YRDAlZrn6ppm6J1FWBLNi@09ErIFpa3PudaNxqyRpgVPerXlxhQlJ6@mXacpsw0wm8Ep60Kf53JdZ6B522kJNDt4yG0hJCbwisCaWli2mkusyJiu5jcZdLYnnOYtNO7lBkob@GaPafuFLG1BdW0G/U5emTT10lg6rIJPqTQVrDCcZOes2RYtq2BXFW2PvGk0YMe1d6Sep@RtLSTH/YFCBj2lBdnP6Xl9Z2IDeE/A1pw0eLSUI5J9qvrBxc0KLi/hHF/MR8MReWvzWjitN/jj5rnhhWZVjxD4hQN7IIEHGHwvasNTGID9HnVnQxh8IN7stGh5PzlhuZUNk9MNEyP23L1o4G5t3FV@7uD96X9Z0Q/HIThocPIZhEIUUxRFd9YoRXQaRvHt1@QOTf9nCA3B73ieTmiCkiSJoigMwwhFcRSj2Lo4fIeif9imLkpzHNdeh9zL8Bc "C++ (gcc) ‚Äì Try It Online") - Boost  
**[Try it online!](https://tio.run/##bY7BboMwDIbvfgo3HACtQ7hJupQp2m1PsBv0gEqqImUBJezQvjxLNlW91AdLtv/v/z1fl8vk@Dp@z5NfMFzD1hvwqNEzxtaiKouPTUdl9dLRGjctNa90fMebruE8ebQ4ukRVYRlG1wDieMZbg7Mf3VKU/7M1rrAl9m5A20Zc67xzeYNW27ZOfk9k9XGj8yy/Oxk3aPbZ22AaZEnsTRVM70@Xwm8xUiaekH35nyhAloIfoC3Tw7RmmO546oMJABwkgRCHWERAOy7k/k0dYPesADL8i7/TihQopYQQnHMBQgoJMjbJH1b0Cw "Python 3 ‚Äì Try It Online") - Python**  
[Try it online!](https://tio.run/##bY7BbsIwDIbvfgqTHtpqrMIk2UKnaLc9wW4th4qGUSlLq6STBi/fJUyICz5Ysv1/v//pPJ9Gx5fhexr9jOEc1t58mV/wqNEzxpaiKov3VUtl9dTSEjcN1c@0f8OL3sBx9GhxcAmswtwPrgbE4YiXGic/uLko/2drXGFL7FyPtom41nnr8hqtts0m@T2QbfYrnWf5zcm4XrOPzgZTI0via9AqmM4fToVfYwRNvCL79D9Rgyz9vrO2TJlpyTDd8dAFEwA4SAIhdrGIgLZcyJdXtYPtowLI8JrgRitSoJQSQnDOBQgpJMjYJL9b0R8 "Python 3 ‚Äì Try It Online") - Python `import regex`  
[Try it online!](https://tio.run/##bU1NS8NAEL3vr3hJoB9Il2x3V7eGJRSqRw/SWxNC1LUG1hA2CbUX/3rcpBYvPphhZt7HuP7lPDhoPJuj@WpobU7Ybfdb6kz5lqDScYLTR2UNrD6ariVA9Y4qGO9N37UJTD3pWDIS9rBiudZhVoeJd9hDTOlqnU@qizWw1Hw23TnFbOblcR7oeTT3HNC4qu5gob/hkCJ8LG1r7hHC1971fkR4TfrVXtaieHjaFcWwoMtFGmRsSW8yNgwRRhdey9a0hHAiGRFi48EYYWsu5O2d2pD1fyAkwvT@6lZMEaWUEIJzLoiQQhLpm@R/UewH "Ruby ‚Äì Try It Online") - Ruby  
**[Try it online!](https://tio.run/##bY5NT4QwEIbv/RUVmrRVIXZptQvZuImJN2/eXA@EHaSxAmnZYJbw27G7idHDzmE@Ms/7zvTdCM43YO1C3ObNwQd8v@d5CyPb0oWlnD1e7QRPb3Ziodvb6Kn76o2FfcQLctzcFXXnoKwaRiw2LSam7Q8Dn0zNyJFPozMDJE3nhznAojA1DmBStvuk7YZTa80n0Pia8v8wDtvwgDUt4Iiws8qlL@VQNeCDinM80efSesjpjCHUML@6A@SYzhxHc3HZi9h5ifEJxFXpwSOUISWQlOsQQiCxyqS6f9BrtLoUCMX4fPVXrYVGWmspZZZlEkklFVIhqezPSvwA "PowerShell ‚Äì Try It Online") - .NET**
## \$\large\textit{Anonymous functions}\$
# [Ruby](https://www.ruby-lang.org/), 21 bytes
```
->s{/(.)\1*+.+\1/!~s}
```
[Try it online!](https://tio.run/##bYxRT4MwFIXf76@4FLOpCx2lrXYjdW/@gr0BMdssSlIJoRAzjP51LOjii@fhJueec762P57HUo/Rg/tYX9ObnN2u6Cpn6@DLfY6DjlN8f62sQatfTOcAsSpxCKZ/03cuRVM/pzholk6BzSJWaE3ymqR@YbOY0igpfltXT7qu7A8isNS8Nd15h4uFn8VFoJfh0meITVvVHZaZLXCHZN/2ZotIcIvk8WCdN2TmwaVpZzuGOFXxdHDGAXCQDITYeDEGLOFC3t2rDST/CSDEmX1ZK6ZAKSWE4JwLEFJIkP5I/odi3w "Ruby ‚Äì Try It Online")
# JavaScript (ES6), 27 bytes
```
s=>!/(.)(?!\1).+\1/.test(s)
```
[Try it online!](https://tio.run/##dY2xTsMwFEV3f4WbSI0twK1rB9xEbjckdjbCECWOFGQ5wc@Boeq3B6cSgqG9w9Mdzrnvo/6qofH9GB7c0Jq50zPow2pDGCXHVcUpu6v4hgUDgQCdS9Db0pvPqfeGZN7Ure2dyShrYg/mxQXju7ox5NS7cQrF6IfGADAIbe/OlA2OZBfj3urDCWEMeL3G/6hhCuzb9yGuVy6jJQbNy8jZhbNv2/eVztLsptQRS4/Jq59MgXFSJM@1hVgTumxcNSwtz3RO8eLgpgYDCAmUcyTlPoZzxHdC5o9Pao9214JQii9vfm3FFVJKSSmFEBLJXOYojycXf1P8Bw "JavaScript (Node.js) ‚Äì Try It Online")
Included for completeness; already done in [Neil's answer](https://codegolf.stackexchange.com/a/77622/17216).
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 29 bytes
```
!($args-match'(.)(?!\1).+\1')
```
[Try it online!](https://tio.run/##dY1BbsMgEEX3c4qJjQqochQCtCRR1F1P0F2ThWXh2hK1U3BkKZbP7mJLUTbtLJgB/ntzaXvrQ2Wdm0h5HKYVI7n/Ctl33hUVZWvO3lYnwdfPJ0H5NB7I7bg5lK23eVEx4rBukNTN5drxARDrkpEbH3pfdzar2tCNMS@WD4zpzP5gkmDWeiTuc3Ne7mnCcWZHtC7YZUR8GDBr2sb2rm4sJoTNoidSRj5S9MNf7R6R3ln6nse@jw88mZXwn4k4GKcUZx6LPNgAIEELUGoXSwgQW6n0y6vZwfavAkhx2XWnjTBgjFFKSSkVKK006Hho@VCJXw "PowerShell ‚Äì Try It Online")
# [Julia](https://julialang.org/) v0.7+, 30 bytes
```
s->!occursin(r"(.)\1*+.+\1",s)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=bU5LTsMwEN3PKaaJ1NqUVri2wW2UsuME7CiLkNrFyHLATja9ChKqkHoN7tHb4DSq2DCLNxq933we3zpnq8O3KY9da2bqJ87Wo6auuxCtJyEjc7phV9P5dMOy60gH0elrX5rKRV2gaQI6tB6DrrbOeh0JBcSda14qh_vCmgTvwfrWeUIL7bcF7ss2dDqpEum037WvxNH1DY7H6J7Y86ic5JPEIp59xCQW7zF7TKYVYoYrzB769rT7rpQJF62jkM7hy8PpI8fehHUVdQTgIBkIsUzDGLAFF_L2Ti1h8d8A5HhuubgVU6CUEkJwzgUIKSTIBJL_RbGh-Rc "Julia - Attempt This Online") / [Try it online!](https://tio.run/##bU3LTsMwELzvV2wTqbUpVLi2qdso5cYXcGs5mNQpRisH2cklPx@cShUX5jCr1by@B/J2N7X1lJ6Oi65phph8YLFgG34WD@vN@iyKx8SnsW4tJVdh20Uk9AGjsxfywSXGAfFK3aclHCvfZvqJPvQUGK9cuFQ41n0cXHZlkVy49l@M@PEZl0ukk/hY1KtylVXEW461WcVXLN5z6IBY4AGLt3k933krd8LdSxzyO5U4m7GxySUACVqAUvsMIUBspdIvO7OH7X8AKPHWfk8bYcAYo5SSUipQWmnQmbT8qxK/ "Julia 0.7 ‚Äì Try It Online")
# [Julia](https://julialang.org/) v1.3+, 28 bytes
```
s->count(r"(.)\1*+.+\1",s)<1
```
[Attempt This Online!](https://ato.pxeger.com/run?1=bVDNTsMwDL77KUwrbQljE1kSyFY6bjzBboxD2ZJRZKXQtJe-ChKakPYWvMjehnRj4oIPtqzvz_LH_rWlsth9uXzfNm5svsN4sa5a37A6YRO-EpejyWglkqvA78SJcvjscldQsBm6qkbC0mNtiw2V3gbGAXFL1XNB2GWli-2tLn1DnvHM-k2GXd7UrY2sCJL12-aFEV9c42CA9CieLvJhOowo4lHHXETxHpNlFM0RE5xj8tCnx9lnRU84c4lDXE9X7g7vKfYiXBfBBgAJWoBSs1hCgJhKpW9uzQym_xVAiseUs9oIA8YYpZSUUoHSSoOOTcs_q9___AA "Julia - Attempt This Online")
*-2 bytes compared to v0.7+, thanks to MarcMush*
# [R](https://www.r-project.org/), 32 bytes
```
\(s)!grepl('(.)\\1*+.+\\1',s,,1)
```
[Attempt This Online!](https://ato.pxeger.com/run?1=bY6xTgMxDIZ3P4XbSk1Mj4r0cpD2dCtTRySWW442KZFOaYmvSxFPwlKQeAXepW9DjoJY8GDL1vf_v1_f4vHdVR_7zl2aE9aSabCJdtdKIadU1-piMp2kITLOMkU_3CdXVyUeKudbK4fcrX0YUgluG-USfUDe73bRMt83MfiwYRlts176YFkeiOgZEL1LUaumk6IOgkquVHm-htVjk2wIx-Pk88BdWjKVsgeVGAnCXuOdbdlKl7BM3MW9XSCKTNw26bpAQdR79eCSyhdYtdsEH6g8f388PY2wFyWCLQPkUCjQep5KKVCzXBfXN2YOs_8KYITfOb9qowwYY7TWeZ5r0IUuoEityP-s1Dn5Cw "R - Attempt This Online")
Beaten by [Alex A.'s non-regex answer](https://codegolf.stackexchange.com/a/77633/17216) [by 2 bytes](https://ato.pxeger.com/run?1=bY_BSgMxEIbv8xRpV5oMrGC6WU277FUQeix46WXdTTSwpDXZFaz4JF6q4GsIPkbfxtku4sU5BDL5v28mb-_h8GHLz76z5_prIyJOKv8smn7XurrqTCNCa6h79oQ4ho7fsbwo2L60jl6msWucn2IBdhvEijnPYr_bBRPjbRW88_dRBFM1K-dNFHtEfAHGnCUl6QXfeI5FLGUxdn39UJEG2WxGnrvY0SWVqcRJyROObGCcNW00wgpaR6-3N74jAFO-Dr1ZMsZTfl1RYMk44qAdmBUWr1C3W-L2WIwfORwfEzZAlIgmAmSQS1BqQSUlyHmm8ssrvYD5fwWQsNOcX1pLDVprpVSWZQpUrnLI6cizP5UcJ_8A "R - Attempt This Online"), or [by 6 bytes](https://ato.pxeger.com/run?1=bY_BSgMxEIbv8xSxK00GVjDdrKZd9yoIPRa89JK2iQaWbM1sPVR8Ei9V8CW8-Rh9G7NdxIsDCUzyf98kb-_x8OHqz13nLvTXUhCaphGdWTVWxLQIz5_xZoJD4PhN9WXF9rXz6W5E3caHEVbg2ijmzAdGu-02WqJ7E4MPDySiNZu5D5bEHhFfgDHvknRtOsGXgWNFtayG07B-NEmDbDxOnhV1qcllLvGs5hlH1jPe2YascCI9Ry_au9AlAHO-iDs7Y4zn_NakwIxxxF7bM3OsXmHdtInbYzV85HB8ylgPpQRZAiiglKDUNJWUICeFKq-u9RQm_xVAxk5zfmktNWitlVJFUShQpSqhTFtZ_KnkMPkH "R - Attempt This Online") with pajonk's improvement.
# Java, 33 bytes
```
s->!s.matches("(.)+\\1*+.+\\1.*")
```
[Try it online!](https://tio.run/##bY5BT@MwEIXv/hWvqQR2AashzhIIKWIPnBYu5QZ78AancXGdKHaAatXf3nVT0ErAHDwaz7zvvaV8kSfLp@etXrVN57EMM@@9Nrzqbel1Y/kkx5flJCelkc7hVmqLvwRo@z9Gl3Be@tBeGv2EVdjRue@0XTz8huwWjg2nwM07@3K/Pf7ZNEZJO0OFYutOZiPHV9KXtXI0opwdPT7GkyO@a3wSsW0eIPNSWqs6aNv2HgWsev34o/O182rFtWUhuvXQxTTHa62NAh3ueS3dnXrzlIVE0BXVo2LK3mVN2LchljeW7gBFnA@h91lhgtkeYgPhl7ZquKpADTfKLnxN2WyKgwMYXtayu/Z0ykbF4fiQDZgA@uRDKy7b1qypYbhCdN/16gKIcIHoRhoXhig4fFEZlpPNZrMdY6dAKZ1yhCQkjYkQ56HimMSniUh/nGXn5PS7ImSMweJDncUZybJMCJEkiSAiFSlJw5Mm/1HxPw "Java (JDK) ‚Äì Try It Online")
# [PHP](https://php.net/), 39 bytes
```
fn($s)=>!preg_match('/(.)\1*+.+\1/',$s)
```
[Try it online!](https://tio.run/##bY9Pb4IwGIfv/RS1Emkn/qkUBbvOy9yyiy7M2zQESRGyqqTF0@JnZ8Vl8bL38Kb59enzvq2KqnlcVEUFnVw0@Qk7hoinTqXlITmmdVZgd4SHZEsf@sP@lo5czwINL09lYmSNUZVpOdyn2VetbUtUeSxr5EHEJhGLprNJFCDCQX7W2CnFmDtK5AdZG/yxeX5bEU6@YZljR32aWitppysyoDsh0PaEiIXNZW9vbOyNvQEl/EaXRGbFuUU4tFbKAbQ5xHdHr2eV411HuF3XjmhxePuSSk2dSK3tPqQj3uPla7JaJ8s4XscLtGzzOURz7LQ7kQXa6IucQ5ugl1QZe7Sfuf7qkKMQvzZd2DIwS400APggoICxyBalgE58FkxnYQQm/xUAXXjT/r0OaQjCMGSM@b7PAAtYAALbAv@uoj8 "PHP ‚Äì Try It Online")
## \$\large\textit{Full programs}\$
# [Perl](https://www.perl.org/) `-p`, 17 bytes (18 bytes including flag)
```
$_=!/(.)\1*+.+\1/
```
[Try it online!](https://tio.run/##bYzBTsMwEETv/orFsdKEtmlc2@DWCtz4Ao6RIlMcGil1rNg50Kq/TjCVEBfmMLurnXnOjL2YJ29AFCUtFZw@SVv56e1CmsoNTs1x3m2yIq/p/bJY1nQzK9JcFfiggwFyVuScpm7sbMC1xfGqqILDcTg5FVm6Io3q2qw39iMciYY0hUj3YcyIXpUrmluzSBb55UbISLt@io/8Gb@Ok9kD4D1@0b2PK86vtwwQrWCy76YF0swJ/AThoL3xCDEkKOJ8F0UpolvGxcOj3KHtf0IogRv7ty2pRFJKzjljjCMuuEAimmB/KPo1uNAN1s9r9w0 "Perl 5 ‚Äì Try It Online")
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 17 bytes
```
M`(.)(?!\1).+\1
0
```
[Try it online!](https://tio.run/##bcshDoAwEERRP7dAkJSQNCw7C1uFRHEDBAgEBkG4f6nD8MR3/z6e89pzHeYtL1uITZiqVZrYroIuZ4UJyFSIQHqlDaMn9H/g4nB3kqpK0GiwEtNvlRc "Retina 0.8.2 ‚Äì Try It Online")
Included for completeness; already done in [Martin Ender's answer](https://codegolf.stackexchange.com/a/77661/17216).
# [Retina 1.0](https://github.com/m-ender/retina/wiki/The-Language), 17 bytes
```
C`(.)(?!\1).+\1
0
```
[Try it online!](https://tio.run/##K0otycxLNPyvquGe8N85QUNPU8NeMcZQU087xpDL4P9/Yy5TQy4TE0sgMDTkMjQyNjE1M7ew5DLCBrgsDC24LCwsTExMjI2NTbhMTE1MuUyBhKkxQqshAA "Retina ‚Äì Try It Online")
# [Pip](https://github.com/dloscutoff/pip), ~~19~~ 18 bytes
```
`(.)(?!\1).+\1`NIa
```
[Try it online!](https://tio.run/##K8gs@P8/QUNPU8NeMcZQU087xjDBzzPx////JiaWQGBoCAA "Pip ‚Äì Try It Online")
Thanks to DLosc.
[Answer]
# Pyth, 7 bytes
```
{IeMrz8
```
[Test Suite](http://pyth.herokuapp.com/?code=%7BIeMrz8&test_suite=1&test_suite_input=3%0A51%0A44999911%0A123456789%0A222222222222222222222%0A818%0A8884443334%0A4545%0A554553%0A1234567891&debug=0).
[Answer]
# Ruby, 23 bytes
Anonymous function. Accepts a string. Regex strat.
```
->n{/(.)(?!\1).*\1/!~n}
```
**Regex breakdown**
```
/(.)(?!\1).*\1/
 (.)            # Match a character and save it to group 1
    (?!\1)      # Negative lookahead, match if next character isn't
                #  the same character from group 1
          .*    # Any number of matches
            \1  # The same sequence as group 1
```
`!~` means if there are no matches of the regex within the string, return `true`, and otherwise return `false`.
[Answer]
# Mathematica, 26 bytes
```
0<##&@@Sort[#&@@@Split@#]&
```
[Answer]
# MATL, ~~13~~ 11 bytes
```
u"G@=fd2<vA
```
Thanks to *Luis Mendo* for saving two bytes!
[**Try it Online!**](http://matl.tryitonline.net/#code=dSJHQD1mZDI8dkE&input=JzEyMzQ1Njc4OTEn)
**Explanation**
```
        % Grab the input implicitly
u       % Find the unique characters
"       % For each of the unique characters
    G   % Grab the input again
    @=  % Determine which chars equal the current char
    f   % Find the locations of these characters
    d   % Compute the difference between the locations
    2<  % Find all index differences < 2 (indicating consecutive chars)
    v   % Vertically concatenate all stack contents
    A   % Ensure that they are all true
        % Implicit end of the for loop
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 4 bytes
```
i@√û∆ë
```
[Try it online!](https://tio.run/##bYyxDcJAEATrQdpk//bs/cwBTVAAgS03QAXENEAzltzW8SIhYbKVZme77/ujal2O9/mq6/G83KoCppGEbUkRIUh9QEKpBFsop9kdOWYG2j9@GkF6/G1@K31uGR8 "Jelly ‚Äì Try It Online")
Semi-based on several of [DLosc's 5-byters](https://codegolf.stackexchange.com/a/251235/85334).
```
   ∆ë    The input is not changed by
  √û     sorting its elements by
i@      their first indices in the input.
```
Kind of like cutting the `F` out of `¬π∆ô`F‚Åº`, but also kind of like cutting the ``·π¢∆ë` out of `i‚±Æ`·π¢∆ë.`
[Answer]
# [Haskell](https://www.haskell.org/), 37 bytes
```
f l=(==)=<<scanl1 min$(<$>l).(==)<$>l
```
[Try it online!](https://tio.run/##bYs7DsMgEET7PcUWFKZBWu@SYMnkLsiyZRQgUbCV4xM7TZq8YjQfzRrqfU6ptQWT77zXfhzrFEoizLGoblS3pM05nK7lEAt6jGWbX2HaUOFeUixzRYM5PLu6Pt5m0Uf6to3BEogMB0RAPYu9XN0A/T/AkQPnnIgws4BYsWAPsfy70gc "Haskell ‚Äì Try It Online")
Uses the same approach as [Luis Mendo's MATL answer](https://codegolf.stackexchange.com/a/77665/20260): creates a vector for each entry which indices equal it, and checks that the result is sorted in decreasing order.
`(<$>l).(==)<$>l` is shorter version of `[map(==a)l|a<-l]`. The function `(<$>l).(==)` that takes `a` to `map(==a)l` is mapped onto `l`.
`scanl1 min` takes the cumulative smallest elements of `l`, which equals the original only if `l` is reverse-sorted. `(==)=<<` checks if the list is indeed invariant under this operation.
A recursive strategy also gave **37 bytes**:
```
f(h:t)=t==[]||f t>(elem h t&&h/=t!!0)
```
[Try it online!](https://tio.run/##bYtBCsIwEEX3c4opSEk31TQTTYV4EXERJCHFJIodcdO7x@LGjW/x4X140c03n1KtQcQjd5atPV@WJSCfhE8@Y0Ru27i13DS7rmY3FbQ4FfZPd2Xc4KukqfgZe8zuIeZ4f/ehW@37VgVaAtG4IiXIQZHeH8wIwz/ASAPGGCJSShGQJg16Ha1@qfwA "Haskell ‚Äì Try It Online")
This checks each suffix to see if its first element doesn't appear in the remainder, excusing cases where the first two elements are equal as part of a contiguous block.
Other approaches:
**42 bytes**
```
f l=and[all(/=a)t|a:b:t<-scanr(:)[]l,a/=b]
```
[Try it online!](https://tio.run/##bYtBDoIwEEX3c4pZuIBEIaVTLcSehLAYECJxqIbWuPHulbhx41v85P3kXTncRpGUJhTH/tKySFY6zuObm76J50MY2K9Zk7ed7Ll0fZcWnj06nH0cVx4i7vDpZfZjwAIXfmThen8VU77Z900ajAKiekMpUJUmczzZGqp/gFUWrLVEpLUmIEMGzDZG/1L1AQ "Haskell ‚Äì Try It Online")
**43 bytes**
```
import Data.List
((==)<*>nub).map nub.group
```
[Try it online!](https://tio.run/##bYu9DsIwEIP3e4obGFqGSGkukEoNEyMvEVBKI5ofNal4/BCxsPANlm3Zi8kvu661Op/iVvBqimE3lwvMuuu07qfjJez3nnmTsBn23OKeqjcuoEYXit3Mo@AB97C6YDMybMsuL/HN5r6lb1sFSA5EY4Nz4IMgeTqrEYZ/gOIKlFJEJIQgIEkSZBMpflf@AQ "Haskell ‚Äì Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 4 bytes
```
)ƒ°f‚Åº
```
[Try it Online!](https://vyxal.pythonanywhere.com/?v=2#WyJBIiwiIiwiKcShZuKBvCIsIiIsIltcIjNcIl1cbltcIjVcIiwgXCIxXCJdXG5bXCI0XCIsIFwiNFwiLCBcIjlcIiwgXCI5XCIsIFwiOVwiLCBcIjlcIiwgXCIxXCIsIFwiMVwiXVxuW1wiMVwiLCBcIjJcIiwgXCIzXCIsIFwiNFwiLCBcIjVcIiwgXCI2XCIsIFwiN1wiLCBcIjhcIiwgXCI5XCJdXG5bXCIyXCIsIFwiMlwiLCBcIjJcIiwgXCIyXCIsIFwiMlwiLCBcIjJcIiwgXCIyXCIsIFwiMlwiLCBcIjJcIiwgXCIyXCIsIFwiMlwiLCBcIjJcIiwgXCIyXCIsIFwiMlwiLCBcIjJcIiwgXCIyXCIsIFwiMlwiLCBcIjJcIiwgXCIyXCIsIFwiMlwiLCBcIjJcIl1cbltcIjhcIiwgXCIxXCIsIFwiOFwiXVxuW1wiOFwiLCBcIjhcIiwgXCI4XCIsIFwiNFwiLCBcIjRcIiwgXCI0XCIsIFwiM1wiLCBcIjNcIiwgXCIzXCIsIFwiNFwiXVxuW1wiNFwiLCBcIjVcIiwgXCI0XCIsIFwiNVwiXVxuW1wiNVwiLCBcIjVcIiwgXCI0XCIsIFwiNVwiLCBcIjVcIiwgXCIzXCJdXG5bXCIxXCIsIFwiMlwiLCBcIjNcIiwgXCI0XCIsIFwiNVwiLCBcIjZcIiwgXCI3XCIsIFwiOFwiLCBcIjlcIiwgXCIxXCJdIl0=)
Takes input as a list of singleton strings. Happens to be a different algorithm to the existing vyxal answer.
## Explained
```
)ƒ°f‚Åº¬≠‚Å°‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å°‚Å™‚Äè‚Å†‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å¢‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å¢‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å£‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå‚Å£‚Äã‚Äé‚Äé‚Å™‚Å°‚Å™‚Å†‚Å™‚Å§‚Å™‚Äè‚Äè‚Äã‚Å°‚Å†‚Å°‚Äå¬≠
)ƒ°    # ‚Äé‚Å°Group by the identity function, by order of first appearance. 
  f   # ‚Äé‚Å¢Flatten the list
   ‚Åº  # ‚Äé‚Å£Does that equal the input?
üíé
```
[Answer]
## Haskell, 44 bytes
```
import Data.List 
((==)<*>nub).map head.group
```
Usage example: `((==)<*>nub).map head.group $ "44999911"` -> `True`.
A non-pointfree version:
```
f x = q == nub q                -- True if q equals q with duplicates removed
  where
  q = map head $ group x        -- group identical digits and take the first
                                -- e.g. "44999911" -> ["44","9999","11"] -> "491"
                                -- e.g  "3443311" -> ["3","44","33","11"] -> "3431"
```
[Answer]
# Python, 56 55 bytes
```
a=lambda s:~(s[0]in s.lstrip(s[0]))&a(s[1:])if s else 1
```
[Answer]
# C#, 119 bytes
```
bool m(String s){for(int i=0;i<9;i++){if(new Regex(i.ToString()+"+").Matches(s).Count>1){return false;}}return true;}
```
---
## Ungolfed
```
bool m(String s) {
    for(int i=0;i<9;i++) {
        if(new Regex(i.ToString() + "+").Matches(s).Count > 1) {
            return false;
        }
    }
    return true;
}
```
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), 4 bytes
```
v·∏ü√û·π†
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwiduG4n8Oe4bmgIiwiIiwiXCIzXCJcblwiNTFcIlxuXCI0NDk5OTkxMVwiXG5cIjEyMzQ1Njc4OVwiXG5cIjIyMjIyMjIyMjIyMjIyMjIyMjIyMlwiXG5cIjgxOFwiXG5cIjg4ODQ0NDMzMzRcIlxuXCI0NTQ1XCJcblwiNTU0NTUzXCJcblwiMTIzNDU2Nzg5MVwiIl0=)
```
v·∏ü  # Index of B in A, vectorized (B will be each individual character in the
    # string / item in the list, and A will be the string/list itself)
√û·π†  # Is the result sorted?
```
Answers that use this method, in chronological order:
* [Dennis ‚Äì Python, 33 bytes](https://codegolf.stackexchange.com/a/77624/17216)
* [isaacg ‚Äì Pyth, 5 bytes](https://codegolf.stackexchange.com/a/77635/17216)
* [Dennis - Julia, 30 bytes](https://codegolf.stackexchange.com/a/77640/17216)
* [Dennis - J, 8 bytes](https://codegolf.stackexchange.com/a/77705/17216)
* [DLosc ‚Äì BQN, 5 bytes](https://codegolf.stackexchange.com/a/251233/17216)
* [DLosc ‚Äì Jelly, 5 bytes](https://codegolf.stackexchange.com/a/251235/17216)
* [Unrelated String ‚Äì Jelly, 4 bytes](https://codegolf.stackexchange.com/a/251241/17216)
# [Vyxal](https://github.com/Vyxal/Vyxal), 5 bytes
```
‚Çå√û«ìU=
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwi4oKMw57Hk1U9IiwiIiwiXCIzXCJcblwiNTFcIlxuXCI0NDk5OTkxMVwiXG5cIjEyMzQ1Njc4OVwiXG5cIjIyMjIyMjIyMjIyMjIyMjIyMjIyMlwiXG5cIjgxOFwiXG5cIjg4ODQ0NDMzMzRcIlxuXCI0NTQ1XCJcblwiNTU0NTUzXCJcblwiMTIzNDU2Nzg5MVwiIl0=)
```
‚Çå     # Parallel Apply - apply the following two elements to the input and keep
      # both results on the stack.
  √û«ì  # Connected Uniquify - Remove occurences of adjacent duplicates.
  U   # Uniquify - Remove all duplicates.
=     # Are the two results equal?
```
Turned out to be a port of [Adnan's 05AB1E answer](https://codegolf.stackexchange.com/a/77651/17216).
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), ~~11~~ 10 bytes
-1 byte thanks to @ovs
```
~/,/'='^:\
```
[Try it online!](https://ngn.codeberg.page/k#eJxLs6rT19FXt1WPs4rh4kpz0FEyVuJKUzI1BJEmJpZAYAhmGxoZm5iamVtYgjhG2IASly5QysLQAqTCwsLCxMTE2NjYBGyQqYkp2FggbWqMYpyhEgDXShno)
`^:` test for spaces - always returns 0s, as the input consists only of digits. The `:` here means monadic.
`^:\` repeat until convergence. This will return a pair of the original argument and a list of 0s of the same length as the argument.
`='` group each. To "group" a list means to make a dictionary that maps each distinct element of the list to the positions where it occurs.
`,/'` raze each, i.e. ignore the keys and concatenate the values. For the list of all 0s this will result in 0,1,...,length-1. For the other list, it will depend on the presence of non-continuous blocks - if there aren't any, the result will be 0,1,...,length-1 too.
`~/` do they match?
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), ~~5~~ 4 bytes
```
‚â°·µçc?
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/pfXa6koGunoFRu/3DXzupHbRseNTU/6liuVFJUmqqnpPeoY4VSWmJOMZBd@3BXZ@3DrRP@P@pc@HBrb7L9///RxjoWhhY6poY6FhYWJiYmxsbGJjomJpZAYGioY2JqYqpjaGRsYmpmbmGpYwrkmhrrGGEDCGWGOgaGhhZAAywsDMHGWJobmRrHAgA "Brachylog ‚Äì Try It Online")
*-1 thanks to DLosc*
Takes input as a list of digits through the input variable, and succeeds or fails as output.
```
‚â°·µç      The input with identical elements grouped in order of first appearance
  c     with the groups concatenated
   ?    is the input.
```
[Answer]
# [Prolog (SWI)](http://www.swi-prolog.org), 40 bytes
```
\[A|S]:-S=[];(S=[A|_];\+member(A,S)),\S.
```
[Try it online!](https://tio.run/##bYzBDoIwEETvfMUeMCmxkNRutWI81A/wwlGIQa1KUgqhGC/@O7bcTJzDvNnd7PRDZ7pH6t7NNJUn9SmqPC32p2pHvKvPudqVy1a3Fz0QRYskoWWRTQu4dwM8a3szjX3AqN0I19ppl0fxEfIUrKFgX@HrfO1u2pEjVQmFtu5N40bSm5cjKUq/UhQOHu@hGbWxJOTykE0xz6IoFiw44taLzZmtOIr1Rm7DsPqncJBMzpASETnnONcIFHOpp@A/ZSz7Ag "Prolog (SWI) ‚Äì Try It Online")
-3 thanks to Jo King
Similar to xnor's second Haskell answer.
This won't work on TIO because it is too old of a version, and it's longer, but I think it's more interesting:
# [Prolog (SWI)](http://www.swi-prolog.org), 57 bytes
```
\A:-clumped(A,B),maplist([X-_,X]>>!,B,C),list_to_set(A,C).
```
[Answer]
# Julia, 35 bytes
```
s->issorted(s,by=x->findfirst(s,x))
```
For whatever reason, `sort` does not take a string, but `issorted` does...
[Answer]
# Factor, 22 bytes
```
[ dup natural-sort = ]
```
Does what it says on the tin. As an anonymouse function, you should `call` this, or make it a `: word ;`.
[Answer]
## Lua, ~~107~~ ~~94~~ 85 Bytes
**13 bytes saved thanks to @LeakyNun**
At least, it beats Java :D. Lua sucks at manipulating strings, but I think it is good enough :).
It takes its input as a command-line argument, ~~and outputs `1` for truthy cases and `false` for falsy ones.~~ Now outputs using its exit code. Exit code 0 for truthy, and 1 for falsy
```
o=os.exit;(...):gsub("(.)(.+)%1",function(a,b)if 0<#b:gsub(a,"")then o(1)end end)o(0)
```
### Ungolfed
Be care, there's two magic-variables called `...`, the first one contains the argument of the program, the second one is local to the anonymous function and contains its parameters
```
o=os.exit;               -- ; mandatory, else it would exit instantly
(...):gsub("(.)(.+)%1",  -- iterate over each group of the form x.*x and apply an anonymous
  function(a,b)          -- function that takes the captured group as parameters
  if 0<#b:gsub(a,"")     -- if the captured group (.+) contain other character than
  then                   -- the one captured by (.)
    o(1)                 -- exit with falsy
  end
end)
o(0)                     -- exit with truthy, reached only when the string is okay
```
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 18 bytes
```
Gather@#==Split@#&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78H1CUmVcS/d8dJFTkoGxrG1yQk1nioKz2X0HfQaG62rhWR6HaVMcQRJnomOhYQqEhRMhQx0jHGChsqmOmY65joWMJEjTSIRLW6nApgEC1BdA8C5BWCx0QNAFDYzA0gdhsCrIE4hYwEwiNsToA6K7a2P8A "Wolfram Language (Mathematica) ‚Äì Try It Online")
`Gather` gathers a list into sublists of identical elements, and `Split` splits a list into sublists of consecutive identical elements. They give the same result if and only if each value appears in only one contiguous block.
[Answer]
# [BQN](https://mlochbaum.github.io/BQN/), ~~9~~ 5 bytes
```
‚â°‚üú‚àß‚äêÀú
```
Anonymous tacit function. Takes a string or a list of integers. [Try it at BQN online!](https://mlochbaum.github.io/BQN/try.html#code=RiDihpAg4omh4p+c4oin4oqQy5wKCkYg4p+oNCw0LDksOSw5LDksMSwx4p+pCg==)
### Explanation
Inspired by [Dennis's J answer](https://codegolf.stackexchange.com/a/77705/16766), though the details are a bit different.
Given two lists, `‚äê` works as follows: for each element of its right argument, it finds the first index of that value in its left argument.
We're using `‚äêÀú`, which passes the same list as both left and right arguments. The result is a list, for each digit, of the index of that digit's first occurrence.
If the digits are grouped together, these indices will occur in ascending order. However, if some copies of digit A are separated by digit B, B's (larger) index will come between the copies of A's (smaller) index.
```
‚â°‚üú‚àß‚äêÀú
    ‚äêÀú  First index of each digit in the argument list
‚â°‚üú      The result is identical to
   ‚àß     The result, sorted ascending
```
]