> For the complete documentation index, see [llms.txt](https://junkeh.gitbook.io/easyph/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://junkeh.gitbook.io/easyph/placeholder-editing/placeholder-splitting.md).

# Placeholder Splitting

Splitting allows you to break down placeholders into multiple parts and use them separately. You can split by number of letters, before specific characters or words, numeric comparison, and regex.

***

## Letter Splitting

Splits a placeholder into fixed-length parts.

```yaml
placeholders:
  split_example:
    placeholder_splits:
      '%player_name%':
        split: [ '2_letters', '2_letters' ]
        outputs:
          first: '<green>First part: {part_1}'
          second: '<blue>Second part: {part_2}'
          remaining: '<yellow>Remaining: {part_3}'

```

Example Input: `"Junkeh"`

**Output**:

* `{part_1} = "Ju"`
* `{part_2} = "nk"`
* `{part_3} = "eh"`

To use the placeholder to display the splits do this: `%easyph_<custom>_<outputname>%`\
so for this example `%easyph_split_example_first%` Will output: <mark style="color:green;">`First part: Ju`</mark>

***

## Number Comparison Splitting

Compares a numeric value to a threshold and outputs based on whether it is greater or less than the value.

```yaml
placeholders:
  split_number:
    placeholder_splits:
      '10 12':  # Example numbers or add placeholder
        split: [ 'greater_than', '10' ]
        outputs:
          above: '<gold>Level is above 10!'
          below: '<gray>Level is below or equal to 10!'

```

Example Input: `"12"`\
Output: `<gold>Level is above 10!`\
Example Input: `"8"`\
Output: `<gray>Level is below or equal to 10!`

{% hint style="warning" %}
To be honest im not 100% this feature works but let me know.
{% endhint %}

***

## Word Splitting

Splits a placeholder before a specific character or word.

```yaml
placeholders:
  split_word:
    placeholder_splits:
      '%player_name%':
        split: [ 'before_character', '_' ]
        outputs:
          first: '<yellow>Before underscore: {part_1}'
          second: '<red>After underscore: {part_2}'

```

Example Input: `"Junkeh_Dev"`

Output:

* `{part_1} = "Junkeh"`
* `{part_2} = "Dev"`

***

## Regex Splitting

Splits a placeholder using regex patterns.

```yaml
placeholders:
  split_regex:
    placeholder_splits:
      'dpg32sasd': # Can be a placeholder
        split: [ 'regex', '[0-9]+' ]
        outputs:
          first: '<red>Before number: {part_1}'
          second: '<yellow>After number: {part_2}'

```

Example Input: `"dpg32sasd"`

Output:

* `{part_1} = "dpg"`
* `{part_2} = "sasd"`

***
