I have a large text file that i need to remove a certain piece of information from, but i am still learning regular expressions and need some help with the search string statement.
Below is an example of the data i am trying to extract:
"id": "12345" (good)
"id": "a123" (bad)
The part i am having trouble with, is that i want to grab the first example, which has ONLY numbers as the value for ID. If there is a letter within the ID, i do not want to grab it. The ID numbers also differ in length, but the format is consistent:
"id": "number_here"
I have the following code but it does not seem to work for what i want to do:
preg_match_all("/\"id\"\:\s\"[0-9]\"/", $input_file)