Perl Regex替换除字符串中的特定域之外的所有域(Perl Regex replace all domain except a particular in a string)
我有一个域名字符串如下:
$string = 'https://code.google.com && http://mycode.com/data && times.com && https://thehindu.com';
我想用
mycode.com/unknown
替换mycode.com
以外的所有域名所以应用正则表达式后上面字符串的输出应该是:
https://mycode.com/unknown && http://mycode.com/data && mycode.com/unknown && https://mycode.com/unknown
我试过下面的正则表达式,但它也改变了
http://mycode.com/data
:$string =~ s/(?<!mycode)[a-z\.]+?\.(com|org|net)/mycode\.com\/unknown/g;
我应该如何修改我的正则表达式以匹配mycode.com
I have a string of domain like below:
$string = 'https://code.google.com && http://mycode.com/data && times.com && https://thehindu.com';
I want to replace all domains except
mycode.com
withmycode.com/unknown
So the output of above string after applying regex should be:
https://mycode.com/unknown && http://mycode.com/data && mycode.com/unknown && https://mycode.com/unknown
I have tried below regex, but it changes
http://mycode.com/data
also:$string =~ s/(?<!mycode)[a-z\.]+?\.(com|org|net)/mycode\.com\/unknown/g;
How should i modify my regex to not match mycode.com
原文:
最满意答案
数据库通常存储在
/data/data/your.applications.package/databases
你可以使用
adb shell
来cd
到那个目录并用sqlite3
打开数据库。The databases are usually stored in
/data/data/your.applications.package/databases
and you can use the
adb shell
tocd
to that directory and open the db withsqlite3
.
相关问答
更多-
LINUX 如何查看JPG文件[2022-06-13]
find -
您可以使用Eclipse直接使用sqlite管理器插件( http://www.coderzheaven.com/2011/04/18/sqlitemanager-plugin-for-eclipse/ ) 从上面引用的网站下载* .jar文件到eclipse中的“dropins”文件夹(打开你的eclipse文件夹,你应该看到它) 然后重新启动eclipse并转到DDMS。 如果尚未显示,您可能必须执行windows-> views-ddms ... 从左侧面板选择您的设备,然后使用文件浏览器转到您的数据 ...
-
仿真器的文件系统不映射到硬盘驱动器上的目录。 仿真器的磁盘映像存储为一个映像文件,您可以通过Eclipse(在工具栏中查找G1图标)或通过仿真器二进制文件来管理(运行“emulator -help”以获取选项的描述) 。 您最好使用命令行中的adb将其插入运行的模拟器。 如果您可以获得特定的目录和文件名,您可以执行“adb pull”以将数据库文件从仿真器和常规硬盘驱动器上取下。 编辑 :删除了对无人机设备的建议,它仅适用于模拟器和您以root身份运行adb的设备。 The filesystem of th ...
-
从Android模拟器连接到LocalHost / 10.0.2.2超时(Connection to LocalHost/10.0.2.2 from Android Emulator timed out)[2022-03-03]
从Android连接到计算机只能在Google Android虚拟设备上使用10.0.2.2。 Android虚拟设备正在侦听10.0.2.2并将所有请求转发到您的计算机。 Genymotion Android虚拟设备正在监听10.0.2.3并将这些请求转发到您的计算机。 10.0.2.2不适用于您的真实Android设备。 如果你想用你的真实设备使用它,你必须设置你的计算机的IP地址,正如先前的回答所建议的那样。 I have figured out the reason why it was not w ... -
adb (Android Debug Bridge)才能通过命令行访问模拟器设备的文件系统。 如果你还没有安装它,你可以在这里下载 。 安装完成后,只需使用几条命令即可查看/访问这些文件: 打开Terminal.app 。 执行adb devices (这应该列出您当前的仿真器设备)。 用adb shell连接到仿真器设备。 将目录cd更改为应用程序数据库所在的文件夹。 键入ls以查看哪些数据库文件存在。 在终端中它看起来像这样 : 列出仿真器设备: $ adb devices List of device ...
-
-wal文件用于Room 1.1.0启用的-wal写日志记录(WAL)。 尝试复制所有三个文件,然后打开.db文件。 WAL是一种标准的SQLite特性,并且已经存在多年,所以大多数最新的SQLite客户端应该能够处理它。 The -wal file is for write-ahead logging (WAL), which Room 1.1.0 enables. Try copying all three files, then opening the .db file. WAL is a stand ...
-
模拟器在内核映像文件中找不到'Linux版本'字符串(Emulator can't find 'Linux version ' string in kernel image file)[2023-12-07]
回答我自己的问题: 如果您为fugu - Nexus Player构建编译,则无法在模拟器上运行构建。 To answer my own question: You cannot run the build on the emulator if you compile for fugu - Nexus Player build. -
您始终可以包含查找有关数据库的信息的方法。 例如,您可以查询sqlite_master表,例如: - Cursor csr = db.query("sqlite_master",null,null,null,null,null,null); 相当于: - SELECT * FROM sqlite_master PRAGMA语句允许您查询/更改内部PRAGMA语句 。 注意使用rawQuery来获取游标中的信息,但是使用execSQL来进行更改,例如分别设置和获取user_version( ...
-
您可以在命令行上使用adb push或通过eclispe使用DDMS导入/导出将数据库放到您的模拟器上 以下是一步一步的详细信息: http : //www.boringmonday.com/jc/2010/11/22/sqlite-database-on-your-android-emulator/ You could use adb push on the command line or DDMS import/export via eclispe to put the db on to your em ...
-
数据库通常存储在 /data/data/your.applications.package/databases 你可以使用adb shell来cd到那个目录并用sqlite3打开数据库。 The databases are usually stored in /data/data/your.applications.package/databases and you can use the adb shell to cd to that directory and open the db with sqli ...