regular expression to find at the end of lines - regex

I have many lines that start like:
text.1
text.2
othertext.21
anothertext.50
dfgtext.161
what I need is to find the lines that has only .1 (not .21, not 11), only anytext.1
I use notepad++
Thanks,

You just have to match the end of the line, so try with \.1$

If it's any text + .1 then try the follwing regex
.+?\.1$

Assuming Notepad++ supports $, the end of line match, \.1$ should work for you.

Related

Notepad++ Remove text before characters but have 2 same characters on every line

Hi masters i need your help on Notepad++ RregExpp
i have text like this :
01:example#mail.com:test
need to convert like this :
example#mail.com:test
Thank you in advance if you help me.
Use expression ^... and replace it with empty string or better with \n like following (and remove the first two characters):
Here is a way to go:
Ctrl+H
Find what: ^[^:]+:(.+)
Replace with: $1
Replace all
Make sure to have checked Regular expresion but NOT . matches newline

Replace string with the same start and end in notepad++

Not much of a expert in regular expression here. My IT colleague dump my a text file which containt all our mailing list. But I need to clean it before using it.
I need to find and delete a string of text which always start by "3EA" and finish by "////".
I try several ways, but no cigars.
Here's some example of the string I need to delete :
3AEAEACjkCjm////
3AEAEACjlCjn////
3AEAEACjnCjp////
Thanks
3AE[a-zA-Z]{9}/{4}
Try this.See demo.
https://regex101.com/r/vN3sH3/61
You could use the below regex,
3EA\S*?////
Add anchors if necessary.
^3EA\S*?////$
Assuming there are always 9 alphabetical characters in between 3AE and ////, in search and replace (in regex mode) replace this pattern with a blank pattern:
3AE[A-Za-z]{9}////

Regular Expression Notepad++ to Find & replace strings

I have strings like following in a line
Q80a_Offline_MElDor_NET
Q80a_Offline_Mr_NET
Q80a_Offline_Mor_NET
I want to remove _NET from them using regex in Notepad++.
I also have following in the same line in the file which I don't want to touch.
Q80a_MElDor_NET
Q80a_Mr_NET
Q80a_Mor_NET
I can find these strings with following search string.
^Q80a_offline_[a-zA-Z]+_NET$
but not sure what to use as replace with regex expression
I want Q80a_Offline_MElDor_NET to be Q80a_Offline_MElDor
please help.
_NET$
Try this.Replace by empty string.See demo.
http://regex101.com/r/yR3mM3/55
or
^(Q80a_offline_[a-zA-Z]+)_NET$
Replace by $1.

^a-zA-Z0-9 excluding spaces?

I am trying to find everything in a paragraph that is not abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 and not space / /gi
/[^a-zA-Z0-9]|[^ ]/gi
the above doesn't work!
You could also try with:
/[^a-zA-Z0-9\s]/gi
If you only want to exclude spaces use:
[^ ]*
Test the regex here if you want.
try ^[\d\w]*$ or ^[\w]*$
as reg' Expression means from ^(start) to $(end) match 0-9a-zA-Z only
for c++ ansistring="^[\\d\\w]*$";
You can use this for
am trying to find everything in a paragraph that is not abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 and not space / /gi
replaceAll("[^A-Za-z0-9\\s]", "")

Regular expression to match not the beginning/end of a line

I would like a regular expression to match only " that
don't come at the start of a line or after white space at the start of a line
don't come at the end of a line or before white space at the end of a line
I guess I need to use lookbehind and lookahead.
So matches the " in
zfgjhsgaf jhsa gd " gjhygf" hgf
But not in
"gjhgjkgjhgjhgkk"
"dfsdfsdf"
For Eclipse, try finding by this regex:
(?<!^\s*)"(?!\s*$)
And replacing with:
\"
See this here
(?<!^)"(?!\s*$)
at Regexr
It works not for the whitespace after beginning of the line. As BoltClock mentioned, variable length look behind is supported only by few engines (I know only .net).
If you use a regex that support it, you can use
(?<!^.*)"(?!\s*$)
A good documentation for look ahead/behind is here in the perldoc.perl.org/perlretut.html#Looking-ahead-and-looking-behind
^\s*"?.*\S.*(").*?\S.*?"?\s*$
Which supports matching ' "foo"bar" ' assuming that is something that you want to find.
Oh, and it only matches if $1 is set
This one should work
^\s*[^"].*".*[^"]\s*$
I think whis re is expressive enougth :
^\s*\S+.*innertext.*\S+\s*$