As a quick check, does the original text contain those backslashes?

A version without the backslashes looks a little more normal to me:
test.FilterPanel.viewId = "136e6c9e-689a-4d24-a3bc-2ace008bee2f"
test.FilterPanel.viewId = \"136e6c9e-689a-4d24-a3bc-2ace008bee2f\"

Also, did you add the spacing around the equal sign, or is it definitely
there in the original text?

A version that should be insensitive to the spacing would be:
test\.FilterPanel\.viewId.?=.?"(.+?)"



On Mon, Jul 15, 2013 at 12:10 PM, Niraj <[email protected]> wrote:

> I have tried both the regex but unfortunately it's not working.
>
> test.FilterPanel.viewId = \\\"138844c6-a873-4867-8cf4-8a7bc5429537\\\";\"}
>
> i want to extract 138844c6-a873-4867-8cf4-8a7bc5429537.
>
> Please let me know regex to extract required value.
>
> Thanks,
> Niraj
>
>
> On Mon, Jul 15, 2013 at 10:45 AM, Niraj <[email protected]> wrote:
>
> > Thanks Guys for the quick response.
> >
> > Currently my application is down due to some issue. Once it is up, i will
> > check this regex and will let you know the results.
> >
> >
> >
> >
> > On Fri, Jul 12, 2013 at 8:17 PM, sebb <[email protected]> wrote:
> >
> >> On 12 July 2013 09:57, Niraj <[email protected]> wrote:
> >> > Can someone please help me in regular expression
> >> >
> >> >
> >> > test.FilterPanel.viewId = \"136e6c9e-689a-4d24-a3bc-2ace008bee2f\"
> >>
> >> > *i want to extract **136e6c9e-689a-4d24-a3bc-2ace008bee2f **from
>  this.
> >> *
> >> >
> >> > *Please let me know what should be correct reg ex *
> >> > *
> >> > *
> >> > *i tried **viewId = \"(.*)\ But got the
> >> > error org.apache.oro.text.MalformedCachePatternException: Invalid
> >> > expression: viewId = \"(.*)\*
> >> > *Trailing \ in expression.*
> >>
> >> It's quite difficult reading your posting because of all the extra *
> >> characters that are scattered about.
> >>
> >> But assuming you start with
> >>
> >> test.FilterPanel.viewId = \"136e6c9e-689a-4d24-a3bc-2ace008bee2f\"
> >>
> >> and want to extract
> >>
> >> 136e6c9e-689a-4d24-a3bc-2ace008bee2f
> >>
> >> Then the way to do it is to take your input, and escape any
> >> meta-characters:
> >> In this case, the \ is the only special char, so it becomes:
> >>
> >> test.FilterPanel.viewId = \\"136e6c9e-689a-4d24-a3bc-2ace008bee2f\\"
> >>
> >> Now put () around the part you want to extract:
> >>
> >> test.FilterPanel.viewId = \\"(136e6c9e-689a-4d24-a3bc-2ace008bee2f)\\"
> >>
> >> Of course this will only extra the exact id, so now you need to make
> >> the id dynamic.
> >>
> >> In this case, the Id seems to consist of lower-case hex and - only,
> >> which is matched by
> >>
> >> [-\da-f]+
> >>
> >> In the above, the - must come first, otherwise it is treated as a
> >> range, as in a-f.
> >> The \d means digit; you could use 1-9 instead
> >>
> >> So the final expression becomes:
> >>
> >> test.FilterPanel.viewId = \\"([-\da-f]+)\\"
> >>
> >> If the Id could include other characters, you could also use the fact
> >> that it is terminated by \, so you could replace
> >>
> >> [-\da-f]+
> >>
> >> by
> >>
> >> [^\\]+
> >>
> >> which means anything except \, repeated any number of times.
> >>
> >> Try this process out in the Tree View Listener regex pane.
> >>
> >> > *
> >> > *Thanks,*
> >> > *Niraj*
> >> > *
> >> > *
> >> > *
> >> > *
> >> > *
> >> > *
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >>
> >>
> >
>

Reply via email to