textpad

How can I use regular expressions in Textpad to remove anything, line by line, after specified characters?

Deadly 提交于 2020-01-15 11:58:06
问题 Suppose I have the following text in Textpad: kwejkewrjl:ksajdlakj e833ekjh:skdjkahak 2098e123809:ksjdkas dkjwhfdkjqhio:skjddksjal 98a09asfdsaok:kwqjeo912ui I would like to remove all characters from each line that occur after the colon. The new text should be: kwejkewrjl: e833ekjh: 2098e123809: dkjwhfdkjqhio: 98a09asfdsaok: 回答1: How about this? Find: :.* Replace with: : Just did this in TextPad on one of my servers. 来源: https://stackoverflow.com/questions/18858334/how-can-i-use-regular

Carriage Return showing in notepad++ but not textpad?

随声附和 提交于 2020-01-13 08:58:30
问题 I have some text files copied out to a server. I typically use and prefer notepad++ to look at text files but on this server, only textpad is installed. This is really strange behavior but I noticed that when I view the EOL chars in notepad++ I can clearly see and search for the CRLF (i.e. \r\n). But when I display the same files in textpad, I am able to search only on the LF (\n) and do not have any hits on the CR (\r). Am I missing something on how Textpad is interpreting the EOL chars? 回答1

multiline regular expression with textpad

大憨熊 提交于 2019-12-23 10:17:05
问题 I can't figure out how to make textpad perform a regular expression that extends multiple lines. I tried using perl syntax with /myregex/m with m as a modifier but that didnt' work. I can't see a checkbox or anything in the editor to tell it to do multiline. anyone have any ideas? 回答1: It is entirely possible, and simple :) You just use \n This search: we\nwill Matches the end of line 1 and the start of line 2 in this dummy text: this is a test and we will see if it matches multiple lines.

Regular expression to search multiple strings (Textpad)

℡╲_俬逩灬. 提交于 2019-12-17 22:43:49
问题 I'm a bit new to regex and am looking to search for multiple lines/instaces of some wildcard strings such as *8768, *9875, *2353. I would like to pull all instances of these (within one file) rather than searching them individually. Any help is greatly appreciated. I've tried things such as *8768,*9875 etc... 回答1: If I understand what you are asking, it is a regular expression like this: ^(8768|9875|2353) This matches the three sets of digit strings at beginning of line only. 回答2: To get the

python做简易记事本

左心房为你撑大大i 提交于 2019-12-16 14:21:24
from tkinter import * from tkinter.filedialog import * from tkinter.messagebox import * import os filename='' def author(): showinfo('大道至简','简易记事本第一版') def power(): showinfo('版权信息','本公司保留版权信息,不可以把本软件用于商业目的!') def myopen(): global filename filename=askopenfilename(defaultextension='.txt') if filename=='': filename=None else: root.title('简易记事本'+os.path.basename(filename)) textPad.delete(1.0,END) f=open(filename,'r') textPad.insert(1.0,f.read()) f.close() def new(): global root,filename,textPad root.title('未命名文件') filename=None textPad.delete(1.0,END) def save(): global filename try: f=open

Regular expressions to replace

一个人想着一个人 提交于 2019-12-12 03:24:20
问题 I need to replace a bunch of lines for SQL queries The format is like "xyzabcd > hdsd + 5 and", "xzbcd_TTM_dfdfd > hdsd + 20 and", "x_TTM_dfsddsdsdfd > hdsd + 20 and" I need to find the keyword TTM and add a "(" at the beginning and " or some condition)" in the end but before the word "and" So the line "xzbcd_TTM_dfdfd > hdsd + 20 and", becomes "(xzbcd_TTM_dfdfd > hdsd + 20 or some condition) and I am trying to do it in Textpad but I can also use Notepad++. Thanks a lot in advance. 回答1: For

Search and Replace in textpad/notepadd++ using RegEx

倖福魔咒の 提交于 2019-12-11 13:38:50
问题 I need to do search and replace in textpad or notepad++. So I am trying to use Regular Expressions. I have some lines like below (C_ABCD_ehfjdhf dj hfdjhfhj and (S_dfdfdddff 20 and (P_ABCD_fmngfngm gfnm and I need to check for the key word ABCD and if found , add a constant value before the last word. In result I want above lines to be as follows (C_ABCD_ehfjdhf dj hfdjhfhj CONSTANT and (S_dfdfdddff 20 and (P_ABCD_fmngfngm gfnm CONSTANT and Since first and third line had the keyword ABCD, the

TextPad “find in files” not matching on simple OR regex

十年热恋 提交于 2019-12-11 01:36:10
问题 I've tried searching files for either/or word scenarios and they always fail to find any results in TextPad. An example is trying to find something like summer|winter where I want to return any files that contain either the word "summer" or the word "winter". This regex works fine in other programs like Notepad++. Why doesn't it work in TextPad? 回答1: Textpad.com online release notes says that they fixed a bug in 7.0.7 related to this where they: Reject "|" as a regular expression 回答2: Textpad

TextPad and Unicode: full support?

旧巷老猫 提交于 2019-12-04 02:47:09
问题 I've got some UTF-8 files created in Mac, and when trying to open them using TextPad in Windows, I get the following warning: WARNING: (file name) contains characters that do not exist in code page 1252 (ANSI Latin 1). They will be converted to the system default character, if you click OK. Linux (GNOME gEdit) can open the same file without complaints. What does the above mean? I thought that TextPad had full UTF-8 support. Can I safely open and edit UTF-8 files using it without corrupting

GUI----记事本项目

匿名 (未验证) 提交于 2019-12-02 23:49:02
记事本项目开发 """ 开发记事本软件 """ # -*- coding:utf-8 -*- from tkinter import * from tkinter . colorchooser import * from tkinter . filedialog import * from tkinter . messagebox import * class Application ( Frame ) : def __init__ ( self , master = None ) : super ( ) . __init__ ( master ) self . master = master self . textpad = None self . filename = None self . pack ( ) self . createWidget ( ) def createWidget ( self ) : # 创建主菜单 menubar = Menu ( root ) menuFile = Menu ( menubar ) menuEdit = Menu ( menubar ) menuHelp = Menu ( menubar ) # 将子菜单加入主菜单栏 menubar . add_cascade ( label = "文本(F)" , menu = menuFile