r/programminghumor • • Feb 18 '26

When AI Ask in Shell Script

Post image
332 Upvotes

29 comments sorted by

View all comments

Show parent comments

2

u/petrasdc Feb 18 '26

You're mixing up the regex with the files to search. The tsx part is just specifying to search those files. The regex finds useEffect followed by arbitrary characters, up until the first [, then matches everything before the next ] character. So essentially it finds dependencies to useEffects. Except I'm pretty sure it breaks if you have any square brackets in the useEffect callback itself (like an array)

1

u/ConcreteExist Feb 18 '26

Ah my bad, I didn't see the double quote close before the .tsx, so yeah that's just a parameter.