Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
thorwhalen authored Feb 8, 2025
1 parent 3a84aa1 commit c883503
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,38 @@ That is, modules are all self contained (so can easily be copy-paste-vendored
Further, many functions will contain their own imports: Those functions can even be
copy-paste-vendored by just copying the function body.


# Examples of utils

## Find and replace

`FindReplaceTool` is a general-purpose find-and-replace tool that can treat the input text as a continuous sequence of characters,
even if operations such as viewing context are performed line by line.

The basic usage is

```python
FindReplaceTool("apple banana apple").find_and_print_matches(r'apple')
```

Match 0 (around line 1):
apple banana apple
^^^^^
----------------------------------------
Match 1 (around line 1):
apple banana apple
^^^^^
----------------------------------------

```python
FindReplaceTool("apple banana apple").find_and_replace(r'apple', "orange")
```

'orange banana orange'

[See more examples in documentation](https://i2mint.github.io/lkj/module_docs/lkj/strings.html#lkj.strings.FindReplaceTool)

[See here a example of how I used this to edit my CI yamls](https://github.com/i2mint/lkj/discussions/4#discussioncomment-12104547)

## loggers

### clog
Expand Down

0 comments on commit c883503

Please sign in to comment.