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 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); Link to comment https://forums.phpfreaks.com/topic/209679-regex-help/#findComment-1096014 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.