Click here to Skip to main content
15,867,999 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
GeneralRe: Problem combining REGEX expressions Pin
jschell24-Jan-23 10:38
jschell24-Jan-23 10:38 
Questioni need a regular expression to match a single word starting with m(...followed by any text but not space and )containing Manager Pin
anandssunku8-Jan-23 23:10
anandssunku8-Jan-23 23:10 
AnswerRe: i need a regular expression to match a single word starting with m(...followed by any text but not space and )containing Manager Pin
Richard Deeming9-Jan-23 0:07
mveRichard Deeming9-Jan-23 0:07 
AnswerRe: i need a regular expression to match a single word starting with m(...followed by any text but not space and )containing Manager Pin
jschell10-Jan-23 7:24
jschell10-Jan-23 7:24 
QuestionSometimes its a bullet item, sometimes it is not, sometimes it is multiple bullet items Pin
Member 158838933-Jan-23 22:31
Member 158838933-Jan-23 22:31 
AnswerRe: Sometimes its a bullet item, sometimes it is not, sometimes it is multiple bullet items Pin
OriginalGriff3-Jan-23 22:37
mveOriginalGriff3-Jan-23 22:37 
GeneralRe: Sometimes its a bullet item, sometimes it is not, sometimes it is multiple bullet items Pin
Member 158838933-Jan-23 23:14
Member 158838933-Jan-23 23:14 
QuestionRegEx- Find files in Linux which match the expression Pin
JDMils3-Jan-23 16:16
JDMils3-Jan-23 16:16 
This is for my VMware vCenter servers where I am trying to clean out extra log files which are no longer required. The type of files for this example are:
Quote:

/storage/log/vmware/eam/web/localhost_access_log..2020-12-06.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-09-13.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-10-31.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-12-13.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-10-03.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-09-08.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-07-21.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-08-03.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-11-30.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-11-08.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-11-27.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-12-14.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-09-28.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-10-01.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-11-29.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-10-19.txt
/storage/log/vmware/eam/web/localhost_access_log..2020-12-05.txt


The expression which works for me in my Linux file system is this one:
find /storage/log/vmware/ -mtime +10 -type f -name "localhost_access_log..2020-[0-9][0-9]-[0-9][0-9].txt"


It uses the Linux "find" command to find the files, the files have to be "mtime=10" 10 days or older. I would like to shorten the regex to simplify it, and using RegExr: Learn, Build, & Test RegEx[^] as my tester, I found that the following regex works:
localhost_access_log\.\.2020-[0-9]{2}-[0-9]{2}\.txt

However when I try it on my Linux filesystem, it fails to produce results. I get nothing returned.
|
+-- JDMils
|
+-- VB6
+-- VB Dot Net
|

AnswerRe: RegEx- Find files in Linux which match the expression Pin
Richard MacCutchan3-Jan-23 21:32
mveRichard MacCutchan3-Jan-23 21:32 
AnswerRe: RegEx- Find files in Linux which match the expression Pin
k50544-Jan-23 9:12
mvek50544-Jan-23 9:12 
GeneralRe: RegEx- Find files in Linux which match the expression Pin
JDMils8-Jan-23 12:56
JDMils8-Jan-23 12:56 
QuestionRegular Expression to find parts of a <script/img src=""> or <link href=""> attribute value Pin
Steve M Penner3-Jan-23 5:13
Steve M Penner3-Jan-23 5:13 
QuestionParsing Session Campaign Data in Data Studio Pin
Michael Oct20223-Jan-23 3:16
Michael Oct20223-Jan-23 3:16 
AnswerRe: Parsing Session Campaign Data in Data Studio Pin
Michael Oct20223-Jan-23 5:01
Michael Oct20223-Jan-23 5:01 
QuestionNeed a bit of help concerning RegEx Pin
Regis Maltais 202112-Dec-22 23:42
Regis Maltais 202112-Dec-22 23:42 
AnswerRe: Need a bit of help concerning RegEx Pin
OriginalGriff12-Dec-22 23:47
mveOriginalGriff12-Dec-22 23:47 
QuestionWhy does this work but this doesn't Pin
Andrew St. Hilaire26-Nov-22 16:52
Andrew St. Hilaire26-Nov-22 16:52 
QuestionRe: Why does this work but this doesn't Pin
k505426-Nov-22 17:30
mvek505426-Nov-22 17:30 
AnswerRe: Why does this work but this doesn't Pin
Andrew St. Hilaire26-Nov-22 17:51
Andrew St. Hilaire26-Nov-22 17:51 
AnswerRe: Why does this work but this doesn't Pin
Richard Deeming27-Nov-22 22:11
mveRichard Deeming27-Nov-22 22:11 
AnswerRe: Why does this work but this doesn't Pin
jschell28-Nov-22 10:42
jschell28-Nov-22 10:42 
QuestionHow to remove an & in the following expressions Pin
Victor Nijegorodov21-Nov-22 8:31
Victor Nijegorodov21-Nov-22 8:31 
AnswerRe: How to remove an & in the following expressions Pin
k505421-Nov-22 10:21
mvek505421-Nov-22 10:21 
GeneralRe: How to remove an & in the following expressions Pin
Victor Nijegorodov22-Nov-22 3:32
Victor Nijegorodov22-Nov-22 3:32 
AnswerRe: How to remove an & in the following expressions Pin
Richard MacCutchan21-Nov-22 21:50
mveRichard MacCutchan21-Nov-22 21:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.