0

Right now I have a regular expression to pick up most characters

([/\w\.-]+)$

However I would like it to also be able to find phrases with the ® symbol such as sdj-0s®. The ® character can appear anywhere any number of times. For example, searching for "www.samplesite.com/eng/sdj-0s®-wer®". Ideally we'd like to account for other possible Unicode characters as well.

What would be the best regex expression to achieve this?

Orin
  • 389
  • 1
  • 4
  • 10
  • 1
    So... add it - `([/®\w.-]+)$`? What is your problem? – Wiktor Stribiżew Aug 20 '18 at 19:36
  • Thanks, is it possible to open it up to all special symbols at once (such as copyright and trademark symbols) or do we have to individually add them to the regex? – Orin Aug 20 '18 at 19:57
  • Add them to the regex. Or try `\p{S}` that stands for all Unicode symbols. – Wiktor Stribiżew Aug 20 '18 at 20:39
  • There is no such thing as a duplicate of "_What does this regex mean ?_". Some info: you realize by adding the `$` you tell the engine to match those characters (in a pack) from that character class, _at the end of the string_ (and nowhere else) ? Is that what you intend ? –  Aug 20 '18 at 23:14
  • [Ediit](https://stackoverflow.com/posts/51937440/edit) your question and add sample lines and expected result. – Toto Aug 21 '18 at 10:44

0 Answers0