Closed zhao414 closed 1 year ago
While it seems similar, it's actually a very different use case that can not be solved with effort less than rewriting or creating a whole new tool.
However, this can be done with editors like VSCode, here is an example:
`DP` Desolation Point
---------------------
| Console Name | Ingame Name | Hint |
| --- | --- | --- |
| `WhalingStationRegion` | Desolation Point | |
| `CaveC` | Cave | |
| `LighthouseA` | Lonely Lighthouse | |
| `WhalingMine` | Abandoned Mine No.5 | |
| `WhalingShipA` | The Riken | |
| `WhalingWarehouseA` | Whale Processing | |
`CH` Coastal Highway
--------------------
| Console Name | Ingame Name | Hint |
| --- | --- | --- |
| `CoastalRegion` | Coastal Highway | |
| `QuonsetGasStation` | Quonset Garage | |
So let's say I want to extract the Console Name
of each entry...
^\| `(.+)` .+\|$
and replace with >>>$1
Here is what the file would looks like then:
`DP` Desolation Point
---------------------
| Console Name | Ingame Name | Hint |
| --- | --- | --- |
>>>WhalingStationRegion
>>>CaveC
>>>LighthouseA
>>>WhalingMine
>>>WhalingShipA
>>>WhalingWarehouseA
`CH` Coastal Highway
--------------------
| Console Name | Ingame Name | Hint |
| --- | --- | --- |
>>>CoastalRegion
>>>QuonsetGasStation
^(?!>>>).+$\n
and replace with nothing>>>WhalingStationRegion
>>>CaveC
>>>LighthouseA
>>>WhalingMine
>>>WhalingShipA
>>>WhalingWarehouseA
>>>CoastalRegion
>>>QuonsetGasStation
>>>
and replace with nothing
WhalingStationRegion
CaveC
LighthouseA
WhalingMine
WhalingShipA
WhalingWarehouseA
CoastalRegion
QuonsetGasStation
^$\n
and replace with nothingWhalingStationRegion
CaveC
LighthouseA
WhalingMine
WhalingShipA
WhalingWarehouseA
CoastalRegion
QuonsetGasStation
Does the plugin support : "Search for ^| (.+)
.+|$ and replace with >>>$1"
the $1 is the thing that we want. So is there anyway to walkthrough the list of all the matches and output each of them directly?
Or can I use the plugin to perform all the steps above, for example, by putting all the steps in one script?
Does the plugin support : "Search for ^|
(.+)
.+|$ and replace with >>>$1"
Yes it just call standard js regex.
Or can I use the plugin to perform all the steps above, for example, by putting all the steps in one script?
I suppose you can because they are all just regex replacements.
I made a update of the code to support this feature request. Please review.
for the example in your post, you can use:
(?<=^\|)(\s*`.+`\s*)(?=(\|.*\|.*\|$))
to match and extract the console name in one step.
Hi, thank you for bring us such a nice tool. obsidian-regex-pipeline is the only tool that can deal with the content within a note using regexp.
I use the note to store the logs. Sometime, I want to find the text with certain pattern within the log. However, rather than replace those matching text with some new text, I want to copy them into the clipboard.
Now, there is an idea: is it possible to extract each of the matching text(or strings) and append them one by one into the clipboard rather than replace them one by one with the given text in the template?
I think this will be very useful.
Looking forward to your reply.