Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm using Notepad++ to look at a broken CSV that won't import.
The pattern should be:
"text","text","text","text","text","text","text","text",date
Is there a way in Notepad++ to find lines that do not match this?
^(?!"[^"]*"(?:,"[^"]*")*,[\d\/]*$).+$
Use a negative lookahead. See this regex101 demo.
One thing that might work, depending on what you want to do with the result, is to simply find and remove all the correct instances. This leaves you with the broken lines. If you do this in a copy, you can then use the result to search for exact matches and find the locations in the original file.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Ok so I have a string encryption thing that goesXorStr( "" ).
How can I put this on all strings without doing them one by one?
You can use the fact, that "Find and Replace" functionality also provides support for regular expressions. Thus, you may easily find all strings, capture them and wrap with XorStr().
In "Find" field, ((\".+?\")|('.+?')) will match all strings with double or single quotes. If you want only the double-quoted, reduce this to (\".+?\").
In "Replace with" field, use: XorStr($1).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am looking to extract all the entries from the following string:
[
"GUID_ID_ONE",
"2016-07-11T18:35:29Z",
"email#address.com",
"HASH_STRING",
"GUID_KEY_TWO",
"GUID_KEY_THREE"
]
I would like a RegEx to extract all the strings, quotes omitted. I have used
"(.*?)"
but this would appear to only find the first string.
Depending on the language you're using, the implementation can be different but you need to use the global modifier(g) to get all the matching strings, like this :
/"(.*?)"/g
Check here
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
i am new to this regex thing, how can we build regex expression for following thig
input==>[User:1490474408:michaelayliffe]
output should be ==>1490474408
input will be anything like below:
1.[User:1490474408:michaelayliffe]
2.[User:12345:dfhdfhdf]
3.[User:56789:utyutyutyu]
Output should be middle value.
Please reply.
(?<=\[User:)[^:]+
Using lookbehind should work for you.
/\d+/g
It is find digits those are middle of your string
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm assuming this is pretty simple but I'm going round in circles
<img src="\/\/i1.ytimg.com\/vi\/sY1S34973zA\/mqdefault.jpg"
I need to extract the sY1S34973zA portion.
I'm using PHP.
Any ideas?
Steve
This should do it:
<img src="[^"]+\/([^"\/]+)\/[^"]*"
The folder name is captured and can be replaced as $1.
I'm a little confused by the backslashes. Are you saying the backslashes are part of the string, or are they simply escaping the forward slashes in whatever language you're using?
If the latter, you'll need to make an adjustment or two above.
You can use this lookahead based regex:
[^/]+(?=\/[^\/]*$
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
preg_match('.*<a\b(?=\s)(?=(?:[^>=]|='[^']*'|="[^"]*"|=[^'"][^\s>]*)*?\shref=['"]([^"]*)['"]?)(?:[^>=]|='[^']*'|="[^"]*"|=[^'"\s]*)*"\s?\/?>/m',$data,result);
how can i work with
php regex
find anchor link here.
This giving syntax error. how can we fix that.
you can see here working status.
http://www.rubular.com/r/G5F6AD5UyL
You need to escape the quotes in your regex - in Ruby that's not necessary because regexes are first-class objects with their own literal syntax, but not in PHP. Also, you need to add delimiters:
preg_match('~.*<a\b(?=\s)(?=(?:[^>=]|=\'[^\']*\'|="[^"]*"|=[^\'"][^\s>]*)*?\shref=[\'"]([^"]*)[\'"]?)(?:[^>=]|=\'[^\']*\'|="[^"]*"|=[^\'"\s]*)*"\s?/?>~m',$data,result);