Skip to content
Advertisement

Tag: parsing

Javascript: Split a string by comma, except inside parentheses

Given string in the form: How can I split it to get the below array format: I have tried normal javascript split, however it doesn’t work as desired. Trying Regular Expression but not yet successful. Answer You can keep track of the parentheses, and add those expressions when the left and right parens equalize. For example-

Parse indentation level with PEG.js

I have essentially the same question as PEG for Python style indentation, but I’d like to get a little more direction regarding this answer. The answer successfully generates an array of strings that are each line of input with ‘INDENT’ and ‘DEDENT’ between lines. It seems like he’s pretty much used PEG.js to tokenize, but no real parsing is happening.

How does a JavaScript parser work?

I’m trying to understand how JS is actually parsed. But my searches either return some ones very vaguely documented project of a “parser/generator” (i don’t even know what that means), or how to parse JS using a JS Engine using the magical “parse” method. I don’t want to scan through a bunch of code and try all my life to

Parse string in javascript

How can I parse this string on a javascript, var string = “http://www.facebook.com/photo.php?fbid=322916384419110&set=a.265956512115091.68575.100001022542275&type=1”; I just want to get the “265956512115091” on the string. I somehow parse this string but, still not enough to get what I wanted. my code: returns: Answer http://jsbin.com/anuhog/edit#source

Parse and add url from clipboard

I need a javascript bookmark to take the url I have in the clipboard parse out the 2 numbers and create a new url, and add a link to the top of the page, that when clicked adds the url to my bookmark menu. Say I have url’s like these http://www.website.com/frontpageeditor.jhtml?sectionID=2844&poolID=6276 javascript:getPoolPageUrl(9800,22713) Then I need to add the numbers to

Advertisement