Recent Questions

مطالب مرتبط با «regex to match» در Recent Questions | نویسنده: استخدام کار

Regex to match conditional IP address

I am wanting to grep for 192.168.22.xxx and 192.168.23.xxx. with a single grep statement where xxx can be any number. I have tried grep -Eo '192.168.2[2][3].[0-9]{1,3}' and grep -Eo '173.235.2[2][3][.][0-9]{1,3}' But this does not retu anything. What is the correct regex I need to be using? Let's block ads!...

ادامه مطلب

regex to match child mount points

I am writing bash script for checking that "child mounts" doesn't exits before "parent mounts" on fstab i.e: if I have the following mounts on fstab: good: fstab mount point first /Application second /Application/home bad: fstab mount point first /Application/home second /Application/ so I want to loop all the mount points on fstab and compare the match to regex that will check regex of "mount point" +/ to catch all child mount points in this case I want to catch any mount point that have /application/ mount point I am trying for child in $MATCH;do if [[ "$child" =~ [//application//] ]];then echo "$child has child mounts before it" fi done by it catches more matches as expected please help m...

ادامه مطلب