[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

RegEx - find and replace strings

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 11
Thread images: 1

File: 2016-05-22 18_33_09-2.png (79KB, 1260x841px) Image search: [Google]
2016-05-22 18_33_09-2.png
79KB, 1260x841px
I want to fully replace multiple Anki field strings using RegEx, but I get weird results (either errors or multiple repetitions of what I want to insert, instead of just one instance).

The fields have very different strings in them.

How do I get rid of the field contents and replace them with something else?

I tried those commands, individually:
*
.*
^.*$
>>
Addendum: I think I get all those repetitions because every single character of the original field gets turned into the string I want to replace it with.
>>
I basically need a way to "nuke and replace", instead of "find and replace", because I don't care what's already in the field.
>>
>>126631
<anything>* <end of file>
>>
>>126833
That corresponds to the third command:
^.*$

It does nothing.
>>
>>126631
Clearly Anki's regex engine is a load of worthless shit.

Export it to JSON, CSV, etc. then use sed.
>>
>>126826
>>126635
Replace .* with a
Replace aa with a, until every field contains only a
Replace a with your payload
>>
>>126870
I want to use exporting as a last resort.

>>126872
I'll try that later.
>>
>>126883
Just learn AWK once, and you'll never again have a problem like this in your entire life.
>>
>>126910
What does AWK stand for?
>>
>>126911
Aho, Weinberger, Kernighan.

Yes, that Kernighan.
Thread posts: 11
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.