Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1042787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:33:51+00:00 2026-05-16T15:33:51+00:00

Here’s a string that I may have: (MyStringIsOneWholeWord *) I have used the following

  • 0

Here’s a string that I may have:

(MyStringIsOneWholeWord *)

I have used the following javascript regular expression to get the text after the bracket if it starts with My.

/(^|\s|\()+My(\w+)/g,

The problem with this is that it includes the first bracket in the result, as that it is the letter/character that found it.

How would I get rid of the bracket in the result?


EDIT

For more information, I am editing the C Language javascript file of the SHJS syntax highlighter.

Here’s all the relevant code for this question:

[
 /(^|\s|\()+My(\w+)/g,
 'sh_keyword',
 -1
]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:33:51+00:00Added an answer on May 16, 2026 at 3:33 pm

    If this was just JS you could use a capture group:

    /(^|\s|\()+(My\w+)/g
    

    Then get the match at that group. However, it appears that SHJS will use the entire match, requiring the use of lookbehind, which is not supported by Javascript’s Regex engine.


    To get around this, I’d suggest you to read the documentation. This part here:

    Once you have defined the language,
    you must convert it to the JavaScript
    format used by SHJS. You will require
    the sh2js.pl script from a source
    distribution of SHJS. The sh2js.pl
    script is written in Perl and requires
    the Parse::RecDescent module.

    Tells me that the resulting JS files aren’t meant to be edited. The docs say SHJS uses the same format as GNU Source-highlighting, which is specified here. So you should be editing the original .lang (link) files and then converting them to .js.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a simple timepicker to jQuery UI's datepicker <script type=text/javascript> /* <![CDATA[ */
Here is my code (Say we have a single button on the page that
Here is what I am trying to achieve in PHP: I have this string:
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here is my problem...I have a page that loads a list of clients and
Here's the deal: I'm in the process of planning a mid-sized business application that
I used javascript for loading a picture on my website depending on which small
Here's the basic setup: I have a thin bar at the top of a
Here is my problem : I have a post controller with the action create.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.