Notepad++ regex code to extract end of line

北战南征 提交于 2019-12-20 07:46:51

问题


i have a source code that i need to capture. the whole file is of one line but i am not able to capture the data that i require.

allow=ok&secret=4326dwsaddsafsd286435dsfs754

now i need to capture this data 4326dwsaddsafsd286435dsfs754 which changes everytime. it contains mixed a-z and 0-9, total lenght 40 letters

i tried using Left and Right selectors by using "secret=" on left but since the source ends at the end of the value, i dont have any thing to put in right selector.

so i need to know how can i capture this data? is there any regex cmd that can let me.?

thanks


回答1:


Try this:
\&secret=(.*)
and then capture the first group with $1




回答2:


Use this regex:

[a-z0-9]*$

It searches for the longest sequence of alpha-numeric characters ([a-z0-9]*) at the end of the string ($).

Test here.



来源:https://stackoverflow.com/questions/57071842/notepad-regex-code-to-extract-end-of-line

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!