i am using spring boot and i want to deploy a rest API war file into tomcat server.
There is no errors in the tomcat server logs but when i call any endpoint i got 404 "not found" and i got the same from the tomcat server . 

java version : 8.
tomcat version : 9.

maybe i miss something , here are my code samples : 

Pom :

```
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.test</groupId>
<artifactId>test</artifactId>
<version>1.1</version>
<packaging>war</packaging>

<name>test</name>
<description>test API</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.1.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-
8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>

        <!-- tag::security[] -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <!-- end::security[] -->

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
</dependencies>

<build>
    <defaultGoal>install</defaultGoal>

    <pluginManagement>
        <plugins>
            <plugin> 
                <groupId>org.springframework.boot</groupId> 
                <artifactId>spring-boot-maven-plugin</artifactId> 
            </plugin> 
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>

        </plugins>
    </pluginManagement>
    <!-- To use the plugin goals in your POM or parent POM -->
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
 </build>
 </project>

```

2.Application.java 

```
@SpringBootApplication
public class TestApplication extends SpringBootServletInitializer {

@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder 
application) {
    return application.sources(TestApplication.class);
    }

public static void main(String[] args) {
SpringApplication.run(TestApplication.class, args);
}

}

```
['https://Stackoverflow.com/questions/47644183', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9053563/']
It's not possible.

an bn is not [regular](https://en.wikipedia.org/wiki/Regular_language), thus matching with a regular expression is mathematically not possible, even with enhanced regular expressions.

You can use the following function to get the range which doesn't use a regular expression:

```js
var input = "a cat bit a dog on the butt b";
console.log(getRange(input, "a", "b"));

function getRange(input, char1, char2){
  var indexStart = -1;
  var count1 = 0, count2 = 0;

  for(var i = 0; i < input.length; i++){
    var char = input[i];
    switch(char){
      case char1:
        count1 += 1; break
      case char2:
        count2 += 1; break;
    }
    if(char == char1 || char == char2){
      if(indexStart == -1)
        indexStart = i;

      if(count1 == count2)
        return [indexStart, i];
    }
  }

  return [-1, -1];
}
```
```js
var a = 0,
    b = 0;
var result = 0;
var patten = /./g;
for (;patten.exec("a cat bit a dog on the butt before running away") != null;) {
    if (RegExp['$&'] == "a") {
        a++;
  if (a == b) {
   result = patten.lastIndex;
        }
    }
    if (RegExp['$&'] == "b") {
        b++;
        if (a == b) {
            result = patten.lastIndex;
        }
    }
}
console.log("1~" + result);
console.log("a cat bit a dog on the butt before running away".slice(0,result));
```

by the way, 朕也会功夫。