Skip to content

Regex search #450

Answered by genivia-inc
nkl0x55 asked this question in Q&A
Jan 9, 2025 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Not sure what you mean. The regex works fine with ugrep. Just make sure you use single '-quotes for the regex pattern and you don't need to escape " with \" when running the ug command in a shell e.g. in bash. For example, here I'm using echo to show that ug finds the full matching pattern as expected:

$ echo '"field1":"1111111111111111","field2":"2222222222222222"' | ug '"field1":"\d{16}","field2":"\d{16}"'
     1:	"field1":"1111111111111111","field2":"2222222222222222"

Note that your regex ("field1\":\"\d{16})\",\"field2\":\"\d{16}\*" has extra ( and ), why is that?

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@nkl0x55
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by genivia-inc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants