andytan91 Posted August 3, 2010 Share Posted August 3, 2010 Hi guys i am trying to regex this string whereby i could change the digit at the "0" part. The requirement is that i only want the number 1. findstr to change digit when regex is carried out and not number 2 as they are in the same text file....thanks in advance!! 1.findstr /i /C:"LSAAnonymousNameLookup = 0" C:\major_security_settings1.txt 2.findstr /C:"LSAAnonymousNameLookup = 0" C:\major_security_settings1.txt Quote Link to comment https://forums.phpfreaks.com/topic/209679-regex-help/ Share on other sites More sharing options...
Adam Posted August 6, 2010 Share Posted August 6, 2010 Give this a go: $str = preg_replace('/(1\.(.*?)) = 0/', '$1 = replacement_value', $str); Quote Link to comment https://forums.phpfreaks.com/topic/209679-regex-help/#findComment-1096014 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.