Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[RegEx] Find and Insert text.

Featured Replies

Hi,
Dose someone know how to find the first occurrence of [SourceNames.x86] in a text file and then add a new text line under it? :dubbio:

What has RegEx to do with this?

You are looking for a very definite text, you can use gsar for this:

http://tjaberg.com/

or FART:

https://fart-it.sourceforge.net/

Otherwise you might want to try using SED (much more powerful but not as easy to use), a windows port  is here:

https://github.com/mbuilov/sed-windows

A number of other tools/utilities do exist, but - generally speaking - they won't manage gracefully the CR+LF (the one after the [SourceNames.x86]).

jaclaz

 

  • Author

I have to use the "JREPL.bat" tool. All other tools have problems with different text encodings.

This works:

JREPL.BAT "[SourceNames.x86]" "[SourceNames.x86]\r\nNew-Line" /XSEQ /L /f "File.txt" /o -

But i try to do something like this:

JREPL.BAT "(RegEx)[SourceNames.x86]\r\n(RegEx)" "Test-Line" /XSEQ /L /f "File.txt" /o -

Edited by Outbreaker

I do not understand your question, then, maybe it is a moving one.

You seemingly asked a question about a problem that you already solved, both the question and the solution you found do not need the use of RegEx expression.

Unfortunately I cannot follow you on the "I have to use" and "All other tools".

If you have to use JREPL.BAT, it has a dedicated thread on another forum, ask your questions here:

https://www.dostips.com/forum/viewtopic.php?t=6044

it is much more likely to find there people familiar with that tool.

RegEx is already - by itself - complex enough, the ways each and every tool implements it may (or may not) be non-standard.

TIme for a distraction:

https://xkcd.com/1171/

jaclaz

  • Author

I now found the RegEx solution for it.

JREPL.BAT "\[SourceNames\.x86\]" "$&\r\nTest-Line" /XSEQ /f "File.txt" /o -

 

Edited by Outbreaker

25 minutes ago, Outbreaker said:

I now found the RegEx solution for it.

Though it doesn't seem at all like there is a RegEx expression anywhere in that.

Anyway, the only important thing :yes: is that you are happy with your solution.

jaclaz

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.