Pages: 1
RSS
Help needed for a close match on endpoint paths
 

My goal is to match each portion of a endpoint path and ensure that it is in proper camelCase (for endpoints with {}, match the contents inside but excluding the brackets. The current regex I am using is as follows:
\/({?[a-z\d](?:[a-zA-Z\d])*}?)+

which is close but is matching on the segments, not the entire line (which I need). My current example dataset is the following (it should match every line but the last):
/true/{testTestId}/{test}/{x}/{y}
/v1/testTest
/v1/tests
/v1/tests/{testId}
/v1/TestTest/{testTestId}

I have tried using boundaries and anchors as I normally would but something is amiss. Any help would be incredible!

Edited: Anthony Jaxon - 18 December 2019 14:10:27
 
Hi Anthony, we don't seem to have any real RegEx specialists here, so please don't waste too much time waiting for an answer here. You'd probably be better off asking in a forum that's fully dedicated to regular expressions. Sorry!
I volunteer as a moderator to help keep the forum tidy. I do not work for Ritlabs SRL.
 
You might like to play with this, perhaps?
Pages: 1